我创建了一个名为 bitcoin_notifications.py 的虚拟环境,现在我要激活它,但是遇到了问题:
PS C:\Users\piotr> bitcoin_notifications\activate.ps1
bitcoin_notifications\activate.ps1 : ```The module
'bitcoin_notifications' could not be loaded. For more information, run
'Import-Module bitcoin_notifications'.``` At line:1 char:1
+ bitcoin_notifications\activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (bitcoin_notifications\activate.ps1:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoLoadModule
在之前分享的结果中,我们读到模块无法加载,如果想要更多信息,需要运行另一个特定命令。
一旦我运行它,
PS C:\Users\piotr> ```Import-Module bitcoin_notifications
Import-Module : The specified module 'bitcoin_notifications' was not
loaded because no valid module file was found in any module
directory.``` At line:1 char:1
+ Import-Module bitcoin_notifications
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (bitcoin_notifications:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : ```Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand```
我们可以理解该目录中没有模块。我只想激活虚拟环境。我该怎么做?
编辑: 我正在复制创建新虚拟环境的方法:
pip install virtualenv
mkdir Environments
cd !$
virtualenv bitcoin_notifications
bitcoin_notifications\activate.ps1
bitcoin_notifications
模块。该模块是否正确安装? - HAL9256pip install virtualenv
mkdir Environments
cd !$
virtualenv bitcoin_notifications
bitcoin_notifications\activate.ps1