0

I have installed python 3.10.2, while creating virtualenv I did pip install virtualenv. then I create myenv (virtualenv mypython), but I got error like this. could you please help me what do I do the error is :

C:\Users\ARROWIN PHOTOGRAPHY\Felix\djangoProject>virtualenv mypython 'virtualenv' is not recognized as an internal or external command, operable program or batch file.

2 Answers2

1

In python3 is better to use venv instead. Here are the steps to create your environment:

In your project directory, open the terminal:

python3 -m venv venv

Then:

source venv/bin/activate

  • Note that `venv` may not be installed by default. On Ubuntu, for example, you need to install the `python3-venv` package. – luator Jan 26 '22 at 07:52
1

Make sure that you have set up the python PATH variables correctly and that in your path e.g. ..\AppData\Local\Programs\Python\Python39\Scripts you can locate the python executable virtualenv.exe

If you are using multiple python versions on your local machine be careful while using PIP install. It is better to use the command pip3.x install ... (x is meant to be a specific version of pip e.g. pip3.9) so you can be sure you installed the virtualenv in the correct version of Python, and afterward, you can also select a specific python version when using virtualenv by virtualenv env -p pythonxx the xx is meant as a python version.