在 python 虚拟环境中安装 Flask 时出现问题
Problem installing flask in a python 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
我该怎么办?
刚刚改了虚拟环境的路径,效果很好
我用 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
我该怎么办?
刚刚改了虚拟环境的路径,效果很好