在 Windows 8.1 中安装 virtualenvwrapper-powershell,导入模块失败 [英] Installing virtualenvwrapper-powershell in Windows 8.1, import-module failing
问题描述
我正在尝试按照此处的指南进行操作,我'我停留在 Import-Module virtualenvwrapper
,PowerShell 不断给我错误:
I'm trying to follow the guide here, and I'm stuck at Import-Module virtualenvwrapper
, where PowerShell keeps giving me the error:
import-module : 指定的模块 'virtualenvwrapper' 不是加载,因为在任何模块目录中都找不到有效的模块文件.
import-module : The specified module 'virtualenvwrapper' was not loaded because no valid module file was found in any module directory.
在行:1 字符:1
- import-module virtualenvwrapper
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : ResourceUnavailable: (virtualenvwrapper:String) [Import-Module], FileNotFoundException
- FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
我真的不知道在这里做什么,因为据我从本指南和其他指南中可以看出,这一步应该是相当简单的.谷歌搜索这个问题并没有真正帮助我,因为我找不到其他有这个问题的人.
I'm at a real loss at what to do here, because as far as I can tell from this guide and others this step should be rather straight-forward. Googling this problem hasn't really helped me here since I can't find anyone else with this problem.
推荐答案
嗯,我实际上已经找到了解决这个问题的方法.我猜 pip install 从未将文件放在 PowerShell 的正确模块目录中.我在我的文档文件夹中创建了一个
WindowsPowerShell\Modules
文件夹,该文件夹不存在但列在我的 PowerShell 模块路径中.然后我从 virtualbucketpera 和 bitbucketpera 中取出 VirtualEnvWrapper 目录将其复制到我刚刚创建的 Modules 文件夹中.Well, I've actually figured my way around this issue. I guess the pip install never placed the files in a correct module directory for PowerShell. I created a
WindowsPowerShell\Modules
folder in my documents folder, which did not exist but was listed in my PowerShell modules path. I then took the VirtualEnvWrapper directory from the virtualenvwrapper-powershell bitbucket and copied it into the Modules folder I just created.然后我不得不使用
Set-ExecutionPolicy Unrestricted
而不是Set-ExecutionPolicy RemoteSigned
如指南中所示,但我随后能够执行导入模块和使用所需的一切.我不确定为什么我必须手动完成所有这些而不是 pip 完成,但我只是希望这可以以某种方式帮助其他人.Then I had to use
Set-ExecutionPolicy Unrestricted
instead ofSet-ExecutionPolicy RemoteSigned
as shown in the guide, but I was then able to do the import-module and use everything needed. I'm not sure why I had to all of this manually instead of pip having done it, but I just hope this can somehow help someone else.这篇关于在 Windows 8.1 中安装 virtualenvwrapper-powershell,导入模块失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!