0

I had this problem for several months now. I have multiple versions of python interpreters located in different folders inside my mac. I have pycharm and anaconda installed. This is so far not an issue as I know that this would enable the choice to configure the environment per project. The problem starts when I try to install a library then it accepts the downloads but library fail to run when imported in the code field. also, the version of the python are the same.

I think it is matter of $Path pointing to the right interpreter.

side problems:

  • brew does not work, pip does.
  • I don't know which packages of libraries installed in which interpreter.
  • I am confused with the use of conda vs pip vs brew. do I need all of them for package management or one is sufficient.
  • I would like to know the easiest way to check the $PATH and modifies to point to the right interpreter in the easiest way possible.

Thank you for your help .

enter image description here

Anas Rzq
  • 53
  • 6
  • Look into pyenv, its main purpose is managing different python versions. You can use `which` to figure out which executable you're using. For example `which python3` or `which pip3`. Easiest way to check the $PATH is `echo`ing it – Yiannis Aug 07 '22 at 10:05

1 Answers1

0

how do you install the libraries? a possible reason could be ambiguity of pip versions and python interpreters.
first, upgrade the corresponding pip modules of every python interpreter.

python3.x -m pip install --upgrade pip

after doing so, install modules with

python3.x -m pip install $MODULE

instead of pip3 install $MODULE. this way you will use the corresponding module and not executable that might be relevant for single version.

jsofri
  • 227
  • 1
  • 10