I’m having trouble with my PATH and can’t seem to find an answer anywhere.
I’m using a virtualenv on my Mac, and when I call which pip
, it confirms this – but when I pip install
anything, it dumps it into my ‘usr/local’ path.
I have export PATH=/usr/local/bin:$PATH
added to my .bash_profile to ensure that user-installed binaries take precedence, but I have {
added in my VSCode settings.json to ensure the right path from there.
"python.pythonPath": "/Virtualenvs/py3/bin/python3.7"
}
More specifically, calling which pip
returns:
/Users/username/Virtualenvs/py3/bin/pip
But pip install telegram
returns:
Requirement already satisfied: telegram in /usr/local/lib/python3.7/site-packages (0.0.1)
Any ideas on why this might be happening?
2
Answers
I was able to solve my problem by adding:
to: /Users/username/Library/Application Support/Code/User/settings.json as well as: /Users/username/Virtualenvs/test_env/build/.vscode/settings.json
It's not a perfect solution, as it will require me to change the settings.json file each time I switch environments.
If anyone has an answer that won't - I'd love to hear it.
Try pip –user to install it to particular user directories