'virtualenv' 不是内部或外部命令,也不是可运行的程序或批处理文件 [英] 'virtualenv' is not recognized as an internal or external command, operable program or batch file

查看:426
本文介绍了'virtualenv' 不是内部或外部命令,也不是可运行的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

安装 Python 和 Djangom 后,我尝试使用 virtualenv 使用 virtualenv 进行 django 项目目的.我使用 pip 安装了 virtualenv.

After I installed Python and Djangom, I'm trying to use virtualenv for django project purpose using virtualenv. I installed virtualenv using pip.

pip install virtualenv # got install successfully

当我尝试运行它时,我收到错误消息

When I tried to run it, I got the error message

C:\Users\gshiv\Desktop\DjangoProject>virtualenv
'virtualenv' is not recognized as an internal or external command,
operable program or batch file.

推荐答案

步骤:- 转到您要在该文件夹上创建 django 应用程序的位置.

steps: - go to where you want create django app on that folder.

然后在命令提示符下运行此命令:python -m virtualenv .

then run this command on command prompt : python -m virtualenv .

(例如 C:\Users\gshiv\Desktop\django>python -m virtualenv .)

(eg. C:\Users\gshiv\Desktop\django>python -m virtualenv .)

其中 django 是我想要运行 virtualenv 的文件夹,.(dot) 表示 virtualenv 将它的所有文件夹安装在 django 文件夹中,否则您可以使用其他文件夹名称.(dot) 这次 virtulenv 在主文件夹(django)中创建一个文件夹) .

where django is the my folder i want run virtualenv and .(dot) indicates virtualenv install all it's folder in django folder otherwise you can use other folder name instead .(dot) this time virtulenv creates a folder in main folder(django) .

  • 运行此命令后:运行 .\scripts\activate 现在您可以在 cmd-prompt (django) C:\Users\gshiv\Desktop\django> 上看到这种类型的行;
  • 即源路径前的主文件夹名称.现在您可以为您的项目安装仅属于该主文件夹的任何模块.
  • after running this command: run .\scripts\activate now you can see this type of line on cmd-prompt (django) C:\Users\gshiv\Desktop\django>
  • i.e main folder name before the source path. now you can install any modules for your project that belongs to that main folder only.

pip install django 工作正常.

pip install django works fine.

这篇关于'virtualenv' 不是内部或外部命令,也不是可运行的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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