I want to create virtual environment using python 3.9.15 version. It will get the global version of python but not that version in virtual environment. can you suggest me solution for that
I tried to do using venv and virtualenv but it didn’t work.
I want to create virtual environment using python 3.9.15 version. It will get the global version of python but not that version in virtual environment. can you suggest me solution for that
I tried to do using venv and virtualenv but it didn’t work.
2
Answers
You could try using
pipenv
, it works predictably for me (and for my team)https://pypi.org/project/pipenv/
A sample Pipfile looks like this
You need to create a
Pipfile
with the version of Python that you want in your project directory, and then runpipenv install
This will install the virtual env with the Python version that you specified and all the packages in the file.
Then you can access the virtual environment shell by using
pipenv shell
.You can read more in their docs: https://pipenv.pypa.io/en/latest/
You have to go to the path of python 3.9.15 version copy that path(in my case
C:UserskiranAppDataLocalProgramsPythonPython39
this is the path, after that add python.exe -m venv venv , It will create virtual environment with the python version 3.9.15