如何在DJango中激活虚拟环境 [英] How to activate Virtual Environment in DJango

查看:543
本文介绍了如何在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.

  1. cd C:\Users\user\Desktop\UserDjangoProject> pip install virtualenv
  2. 要创建venv,请运行virtualenv -p python3 venv
  3. 激活virtualenv venv\Scripts\activate
  4. 它看起来像这样(venv) C:\Users\user\Desktop\UserDjangoProject>
  5. 然后运行pip install -r requirements.txt
  6. 运行django项目,运行此./manage.py runserver
  1. cd C:\Users\user\Desktop\UserDjangoProject> pip install virtualenv
  2. For Create a venv run this virtualenv -p python3 venv
  3. Activate virtualenv venv\Scripts\activate
  4. It will look like this (venv) C:\Users\user\Desktop\UserDjangoProject>
  5. Then run pip install -r requirements.txt
  6. Run the django project run this./manage.py runserver

这篇关于如何在DJango中激活虚拟环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆