I have a problem with Linux in PC. I installed python3.8. I want work with python 3. When I create a virtualenv file it gets created with python2, but I don't want work with python2. How can I enable python2?
-
can you post the code you're using to create the virtualenv?Kelvin– Kelvin2019-12-20 15:31:21 +00:00Commented Dec 20, 2019 at 15:31
-
1Type python3 instead of python while executing commands.dannyxn– dannyxn2019-12-20 15:31:31 +00:00Commented Dec 20, 2019 at 15:31
-
1Does this answer your question? Using Python 3 in virtualenvD Malan– D Malan2019-12-20 15:31:59 +00:00Commented Dec 20, 2019 at 15:31
-
virtualenv file nameuser11882855– user118828552019-12-20 15:33:37 +00:00Commented Dec 20, 2019 at 15:33
-
Is there a typo in "How can I enable python2?", you do not want to run any python2 in this venv. You want a python3.x interpreterAlanSE– AlanSE2019-12-20 15:38:19 +00:00Commented Dec 20, 2019 at 15:38
Add a comment
|
2 Answers
Perhaps you can try to locate the location of the python version you want to use the interpreter of (eg. get its path through which python3). Once obtained the path you can create the enviroment specifying the location of the interpreter you want to use for that virtual environment virtualenv -p /usr/bin/python3.6 venv