Python 在vscode上安装virtualenv后出错
我是编程新手,在我的vscode中安装了Python 在vscode上安装virtualenv后出错,python,python-2.7,virtualenv,Python,Python 2.7,Virtualenv,我是编程新手,在我的vscode中安装了virtualenv之后遇到了这个错误。请帮帮我 virtualenv : The term 'virtualenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
virtualenv
之后遇到了这个错误。请帮帮我
virtualenv : The term 'virtualenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ virtualenv myprojectenv
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (virtualenv:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
当您仅在powershell或命令提示符中键入
virtualenv myproject
时,它不知道该代码以任何方式实际与哪个程序相关(并且它无法识别代码)
如果您在python3中使用python-m virtualenv myprojectenv
(在Python2中)或python-m venv myprojectenv
,您应该会成功。这将调用python和名为virtualenv的模块(即-m)
这将在您的powershell当前所在的目录中创建虚拟环境文件夹。因此,如果您的powershell位于C:\users\xxx>,它将在那里创建。因此,在创建之前,您应该确保导航到所需的位置
编辑:添加版本这能回答你的问题吗?作为初学者,你的第一步应该是用谷歌搜索错误消息。例如,你会找到上面已经回答问题的链接。