问题
I'm trying to create a virtual environment for my current Django project using
python3 -m venv env
however the command doesn't create any directory with bin/include/lib folders. What exactly am I missing here?
回答1:
I was having this same problem. I was able to get venv working by uninstalling Python and reinstalling it (I'm using the Anaconda distribution). The py -m venv test
command still doesn't have any output after running it, but now it creates a folder for me and I can activate the test environment.
回答2:
Sometime system's path environment is not aware of virtualenv.exe
solution:
install virtualenv
pip install virtualenv
run command in the directory where you want virtual environment :
python3 -m virtualenv venv
回答3:
why do you have to write python3 -m venv env
when you base is installed as python3.6 itself?
Just do pip install virtualenv
this should install virtualenv package if not already installed, then
virtualenv envname
this will run and should give you a message like this, I have created a env called testenv
:
C:\Users\Admin\python_projects\venvs>virtualenv testenv
Using base prefix 'c:\\python37'
New python executable in C:\Users\Admin\python_projects\venvs\testenv\Scripts\python.exe
Installing setuptools, pip, wheel...
done.
If you get this, it is a success, else do let us know what you get, after this you must cd
into the Scripts
folder and then run activate
回答4:
pip install virtualenvwrapper-win try to install it and do it again
回答5:
Install and create through:
pip install virtualenv
virtualenv <your_virtualenv_name>
Then activate the environment, by going to ./your_virtualenv_name/Scripts folder and then run:
activate
来源:https://stackoverflow.com/questions/58117467/python-venv-not-creating-virtual-environment