virtualenv虚拟环境

安装virtualenv

pip install virtualenv -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
pip install virtualenvwrapper -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

创建

virtualenv xxx
or
virtualenv --system-site-packages xxx # 创建环境,继承原安装的模块

常见问题

vs code使用

问题

& : 无法加载文件 C:\virtualenv\xxxxx\Scripts\Activate.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。

解决:

转到“开始”菜单,然后搜索“ Windows PowerShell ISE”
右键单击x86版本 如果64位 选另一个,然后选择“以管理员身份运行”。
在顶部,粘贴Set-ExecutionPolicy RemoteSigned ; 运行脚本。 选择“全是”。
对64位版本的Powershell ISE(非x86版本)也重复这些步骤。

posted @ 2022-04-19 11:31  默小柒  阅读(46)  评论(0)    收藏  举报