config icon indicating copy to clipboard operation
config copied to clipboard

Brew leads to mixed up python paths

Open Libretto7 opened this issue 2 months ago • 4 comments

Using brew to install a python program also installs python3 and pip3 into /home/linuxbrew/.linuxbrew/ . But there's also a python(3) and pip(3) on the host.

The problem is that when the user uses the commands python or pip, it defaults to the programs installed on the host and when the user uses python3 or pip3 the programs of the brew install get used.

So if you want to use python without spinning up a distrobox (which should be possible), the different paths can lead to confusion. For example:

  • install module with pip
  • run a program using the module with python3
  • "module not found" error

The brew python should not be in PATH as it is just a dependency of brew programs and should not be used directly. pip3 install also tells you that this pip (the brew one) should not be used.

Libretto7 avatar Apr 26 '24 15:04 Libretto7