Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to Create Virtual Environment by using Command?

In my computer has already installed python 3.11.4 and python 3.12 (latest version).
But provided path in "Edit the system environment variable" 3.12 only.
(Unchecked "Add Python 3.11 to PATH" check box when Install Python 3.11.4)

I need to create virtual environment for some project by using python 3.11 version.
So, that’s why I installed 3.11.4 version too.

After that, I tried to create virtual environment with execute the following command in CMD :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

python3 -m venv --python=C:\Python\Python311 MyVenv

(And also tried with this command 🙂

python3.11 -m venv MyVenv

But it gave me Error as follows :

Python was not found; run without arguments to install from the Microsoft Store, 
or disable this shortcut from   Settings > Manage App Execution Aliases.

When I try to create VENV by using 3.12 version It was successfully created !

Q :
How to control multi-version of python same local machine ?
How to create VENV with my prefer virsion in multi-version installed machine ?

>Solution :

Use this Command for 3.11 :

C:\Python\Python311\python.exe -m venv MyVenv

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading