I uninstalled Virtualenv 16.6.0
. I'm using PyCharm
with virtualenv version 15.1.0
. Update: Tried the creating /venv
in create projects but the message is this there and now the venv directory
is yellow. When I type virtualenv
I get:
Running virtualenv with interpreter /usr/bin/python2
You must provide a DEST_DIR
Usage: virtualenv.py [OPTIONS] DEST_DIR
Everything else runs Python 3.7
apt policy python3-django
python3-django:
Installed: 1:1.11.20-1ubuntu0.2
Candidate: 1:1.11.20-1ubuntu0.2
Version table:
*** 1:1.11.20-1ubuntu0.2 500
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
apt policy python3-virtualenv
python3-virtualenv:
Installed: 15.1.0+ds-2
Candidate: 15.1.0+ds-2
sudo apt install python3-virtualenv
python3-virtualenv is already the newest version (15.1.0+ds-2).
python3-virtualenv set to manually installed.
Update: Tried both commands
sudo apt install python3-pip
python3-pip is already the newest version (18.1-5).
pip3 install virtualenv
Requirement already satisfied: virtualenv in /usr/lib/python3/dist-packages (15.1.0)
Install virtualenv with pip3 and it will default to using python3 as the interpreter
If all you are looking to do is set your virtual environment to python3 then you would use the command
For PyCcharm to use python3 you have to do it from within PyCharm itself. The remainder of my response is taken directly from https://www.cs.rit.edu/~csci141/Docs/PyCharm-Setup.html.
All I had to on
PyCharm-
was the click on the bottom right of the screen, the current interpreter- change toPython 3
- then it installedPython 3.8
onPycharm
.