本文介绍了如何在DJango中激活虚拟环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前在Windows上,并且Venv没有被激活未激活的ENV ,有没有什么办法解决这一问题.预先感谢你们!帮助一个新手!
I am currently on Windows and the Venv is not getting activatedUnactivated ENV, Is there any way to fix this. Thanking you guys in advance! Help out a newbie!
推荐答案
在Windows中:按Windows(或Windows + R),然后键入"cmd":在普通模式下运行命令提示符.
In windows:Press Windows (or Windows+R) and then type "cmd": Run the Command Prompt in normal mode.
-
cd C:\Users\user\Desktop\UserDjangoProject> pip install virtualenv
- 要创建venv,请运行
virtualenv -p python3 venv
- 激活virtualenv
venv\Scripts\activate
- 它看起来像这样
(venv) C:\Users\user\Desktop\UserDjangoProject>
- 然后运行
pip install -r requirements.txt
- 运行django项目,运行此
./manage.py runserver
cd C:\Users\user\Desktop\UserDjangoProject> pip install virtualenv
- For Create a venv run this
virtualenv -p python3 venv
- Activate virtualenv
venv\Scripts\activate
- It will look like this
(venv) C:\Users\user\Desktop\UserDjangoProject>
- Then run
pip install -r requirements.txt
- Run the django project run this
./manage.py runserver
这篇关于如何在DJango中激活虚拟环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!