skip to Main Content

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 {
"python.pythonPath": "/Virtualenvs/py3/bin/python3.7"
}
added in my VSCode settings.json to ensure the right path from there.

More specifically, calling which pip returns:

/Users/username/Virtualenvs/py3/bin/pip

But pip install telegramreturns:

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


  1. Chosen as BEST ANSWER

    I was able to solve my problem by adding:

    {
        "python.pythonPath": "/Virtualenvs/py3/bin/python3.7",
        "python.linting.pylintEnabled": true,
        "python.linting.enabled": true,
        "[python]": {
    
        },
    

    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.


  2. Try pip –user to install it to particular user directories

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search