问题描述
我已经完美安装了 python 2.7 和 pip,并且我一直以管理员身份运行 PowerShell.
I have python 2.7 installed perfectly, and also pip, and I have been running the PowerShell as admin.
我做到了:
pip install virtualenv
和
pip install virtualenvwrapper-powershell
他们都成功了.
我也这样做了:
mkdir '~.virtualenvs'
但是,每当我尝试:
Import-Module virtualenvwrapper
它总是让我出现这个错误:导入模块:未加载特定模块virtualenvwrapper",因为在任何模块目录中都找不到有效的模块文件.
it always gets me this error:Import-Module: The specific module 'virtualenvwrapper' was not loaded because no valid module file was found in any module directory.
我再次 pip install virtualenvwrapper-powershell 只是为了确保,我得到了这个:要求已经满足(使用--upgrade升级):c:\python27\lib\site-packages中的virtualenvwrapper-powershell
I did pip install virtualenvwrapper-powershell again just to make sure, and I got this:Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper-powershell in c:\python27\lib\site-packages
可能有什么问题?
推荐答案
当我尝试做与您所做的完全相同的事情时,我遇到了同样的问题.最后我想通了.我发现我安装的 virtualenvwrapper 不知何故不在当前文件夹 (C:) 中.相反,它隐藏在文件夹中:
I met the same problem when I tried to do the exact same thing as what you did. Finally I figured it out. I found that the virtualenvwrapper I installed is somehow not in the current folder (C:). Instead, it is hidden in the folder:
C:\Python27\Lib\site-packages\Users\*myusername*\Documents\WindowsPowerShell\Modules\VirtualEnvWrapper
我建议你去你的 Python 文件夹并尝试搜索类似
I recommend you go to your Python folder and try to search something like
"\Lib\site-packages\Users\*myusername*\Documents\WindowsPowerShell\Modules\"
如果你能在那里找到VirtualEnvWrapper模块,那么当你输入命令时,你只需要包含完整的路径.
and if you can find the module VirtualEnvWrapper there, then when you type the command, you just need to include the complete path.
我希望它会有所帮助.
这篇关于将 virtualenvwrapper 导入 Powershell 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!