How can I set the path for python3 correctly?

$ echo $PATH /usr/local/share/python:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin 

So / usr / local / bin is in my path.

when i do `which python3 '

 /usr/local/bin/python3 

When I try to create virtualenv

 mkvirtualenv py3000 --python=python3 The executable /Users/misdirectedpuffin/python3 (from --python=/Users/misdirectedpuffin/python3) does not exist 

Virtualenv works when using python by default, i.e. mkvirtualenv testenv' and when doing 'mkvirtualenv py3000 --python=/usr/local/bin/python3

It seems to look like in $ HOME for python3. How can i fix this?

** edit **

I can also set export python3=/usr/local/bin/python3 to bash_profile and then call $python3 with --python=$python3 , but I really want --python=python3 without a dollar sign.

+6
source share
1 answer

After doing the brew doctor I was told the following:

 Warning: /usr/local/share/python is not needed in PATH. Formerly homebrew put Python scripts you installed via `pip` or `pip3` (or `easy_install`) into that directory above but now it can be removed from your PATH variable. Python scripts will now install into /usr/local/bin. You can delete anything, except 'Extras', from the /usr/local/share/python (and /usr/local/share/python3) dir and install affected Python packages anew with `pip install --upgrade`. Warning: /usr/bin occurs before /usr/local/bin This means that system-provided programs will be used instead of those provided by Homebrew. The following tools exist at both paths: 

After making these changes, I was able to mkvirtualenv py3000 -p python3

0
source

Source: https://habr.com/ru/post/957977/


All Articles