1

I hope my problem is described well enough to be able to be understood.

I am in a course following along trying to create a virtual env on VScode and it keeps failing to create a virtual environment After typing in pipenv install requests, it tells me that it is using:

/anaconda3/bin/python (3.6.5) to create virtualenv…

After seeing this, I realized that I am running 3.7.4 and it is using 3.6.5 to create the virtual env

the response I'm getting on the VScode terminal is:

[pipenv.exceptions.VirtualenvCreationException]: /anaconda3/bin/python: No module named virtualenv

I believe this(the path/interpreter being used) is the reason it is failing

What I've tried to do to remedy the problem is, go to the json settings on VScode and change the path. Did not work

I've tried to look up some youtube videos to see what my options on terminal are to fix/ change the path. Couldn't figure it out. Most likely the answer is in front of me but cant seem to figure it out.

After some googling, I checked to see the response when typing

type -a python

printed back to me is:

python is /anaconda3/bin/python

python is /Users/B/miniconda3/bin/python

python is /usr/bin/python

python is /anaconda3/bin/python

python is /Users/B/miniconda3/bin/python

then in the terminal after changing path settings, typing which python I get back:

/anaconda3/bin/python

$ which python3

/Library/Frameworks/Python.framework/Versions/3.7/bin/python3

$ which python

/anaconda3/bin/python
target021
  • 73
  • 8
sas
  • 11
  • 2

1 Answers1

0

See the accepted answer for details on how to set the desired version to the PATH variable.

The problem of multiple python versions can be solved by setting the desired version as the PYTHONPATH. This way, whenever you try to install modules, create venvs or anything, it will be using the correct version.

I hope this helps/provides value :)

Anthony R
  • 2,739
  • 1
  • 12
  • 11