导入模块 virtualenvwrapper

Import-Module virtualenvwrapper

我正在使用 powershell。 我成功安装了virtualenvwrapper-powershell。

但是当我输入'Import-Module virtualenvwrapper'时,我得到如下错误:

PS C:\Python27> Import-Module virtualenvwrapper Import-Module : The specified module 'virtualenvwrapper' was not loaded because no valid module file was found in any module directory. At line:1 char:1

Import-Module virtualenvwrapper ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : ResourceUnavailable: (virtualenvwrapper:String) [Import-Module], FileNotFoundException FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

如果你能给我一些建议就太好了......

您需要将模块存储在与模块同名的文件夹中,或者需要将 .psm1 与导入命令一起使用。对于您的情况,您需要将模块存储在以下路径中

C:/Python27/virtualenvwrapper/virtualenvwrapper.psm1

因此您可以使用此命令

Import-Module virtualenvwrapper

或使用此命令调用您的模块

Import-Module virtualenvwrapper.psm1

如果这些都不起作用,那么您可能会发现这个 link 有帮助

您需要将VirtualEnvWrapper 文件夹粘贴到以下目录。对我有用

**

` C:\Windows\System32\WindowsPowerShell\v1.0\Modules

`

**