0

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?

D Malan
  • 10,272
  • 3
  • 25
  • 50

2 Answers2

5

You can set a python version while creating a new virtual environment using the -p flag.

virtualenv -p python3.8 my-env-name
Shuvojit
  • 1,390
  • 8
  • 16
0

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