在python虚拟环境中安装Flask时出现问题

时间:2020-07-19 14:04:48

标签: python flask pip virtual-environment

我使用python -m venv virtual创建了一个虚拟python环境,然后尝试使用virtual\Scripts\pip install flask安装flask。 但是后来我得到了这个错误:

virtual\Scripts\pip : The module 'virtual' could not be loaded. For more information, run 'Import-Module virtual'.
At line:1 char:1
+ virtual\Scripts\pip install flask
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (virtual\Scripts\pip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoLoadModule

当我尝试Import-Module virtual时,我得到了:

Import-Module : The specified module 'virtual' was not loaded because no valid module file was found in any module directory.
At line:1 char:1
+ Import-Module virtual
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (virtual:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

我该怎么办?

1 个答案:

答案 0 :(得分:0)

我刚刚更改了虚拟环境的路径,并且效果很好