Zach
Zach

Reputation: 3

installing python packages to a different interpreter (changing from anaconda)

I usually use anaconda as my primary python ide. The project I am working on requires google's ortools which is unavailable for anaconda. I decided to use vs code and python 3.8.2 to code the software. The issue I am running into is that I can't install the needed modules for my project to this new interpreter. When I run 'pip install -U googlemaps' I get:

Requirement already satisfied: googlemaps in /Users/boss/opt/anaconda3/lib/python3.7/site-packages (4.4.2) Requirement already satisfied: requests<3.0,>=2.20.0 in /Users/boss/opt/anaconda3/lib/python3.7/site-packages (from googlemaps) (2.22.0) Requirement already satisfied: certifi>=2017.4.17 in /Users/boss/opt/anaconda3/lib/python3.7/site-packages (from requests<3.0,>=2.20.0->googlemaps) (2019.9.11) Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/boss/opt/anaconda3/lib/python3.7/site-packages (from requests<3.0,>=2.20.0->googlemaps) (1.24.2) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/boss/opt/anaconda3/lib/python3.7/site-packages (from requests<3.0,>=2.20.0->googlemaps) (3.0.4) Requirement already satisfied: idna<2.9,>=2.5 in /Users/boss/opt/anaconda3/lib/python3.7/site-packages (from requests<3.0,>=2.20.0->googlemaps) (2.8)

It seems that the install wants to default to anaconda, but I don't want this. The file path of my new interpreter is: /usr/bin/python3 .

How can I change the pip install location to go to the needed interpreter?

Upvotes: 0

Views: 2417

Answers (1)

Luca Sans S
Luca Sans S

Reputation: 116

So the interpreter should always be in /usr/bin/python3.

If you interpreter path was, let's say, /home/foo/vsstudio/bin/python3 you'd install a module by running the following in BASH

/home/foo/vsstudio/bin/python3 -m pip install [YOUR PACKAGE]

Easy enough?

Upvotes: 0

Related Questions