win11下面的virtualenv的使用(没写完)

安装命令

pip install virtualenv

pip install virtualenv-win

控制面板-Administrator环境变量配置

VIRTUALENV_CONFIG_FILE=E:\ENVS\virtualenv.ini

Powershell设置

一、Powershell终端输入下列命令

python 复制代码
Test-Path $profile
New-Item -path $profile -type file --force

上述命令会生成一个文件

二、

C:\Users\Administrator\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

内容修改如下:

python 复制代码
Set-Alias  py3.6  E:\ENVS\python3.6\Scripts\activate.ps1
Set-Alias  py3.11  E:\ENVS\python3.11\Scripts\activate.ps1
E:\ENVS\python3.6\Scripts\activate.ps1

activate.ps1是默认就有的,不用修改

cmd调试用命令

查看历史命令doskey /history

Powershell调试用命令

|-------------------------------------------------|--------|
| 命令行 | 用途 |
| type .\Microsoft.PowerShell_profile.ps1 | 查看文件内容 |
| get-content .\Microsoft.PowerShell_profile.ps1 | 查看文件内容 |

Powershell修改脚本执行权限

python 复制代码
PS C:\Users\Administrator\documents\windowspowershell> get-executionpolicy
Restricted
PS C:\Users\Administrator\documents\windowspowershell> set-ExecutionPolicy RemoteSigned
PS C:\Users\Administrator\documents\windowspowershell> get-executionpolicy
RemoteSigned

整合Sublime

Ctrl+Shift+P

安装

install package、virtualenv

preference->Package settings->Virtualenv->Settings - User

添加内容如下:

复制代码
{
"virtualenv_directories":
["E:\\ENVS",
"E:\\ENVS\\python3.6",
"E:\\ENVS\\python3.11",

]
}

①输入virtualenv,选择activate

②选择虚拟环境版本

③Sublime中选择Tools->Build System->Python+Virtualenv(这一步的作用是,依赖会找到虚拟环境中的依赖)

最终效果如下

一打开powershell会自动进入虚拟环境

一些尚不确定的东西

app_data_dir=C:\Users\Administrator\AppData\Local\pypa\virtualenv(这个不知道有啥用,看了下文件,都是一些pip相关的whl文件,好像没法修改位置)

相关推荐
没有梦想的咸鱼185-1037-16631 分钟前
AI大模型支持下的:CMIP6数据分析与可视化、降尺度技术与气候变化的区域影响、极端气候分析
人工智能·python·深度学习·机器学习·chatgpt·数据挖掘·数据分析
Ratten12 分钟前
批量识别图片文字保存到 excel 中
python
WSSWWWSSW32 分钟前
Seaborn数据可视化实战:Seaborn多变量图表绘制高级教程
python·信息可视化·数据分析·matplotlib·seaborn
ShawnLeiLei1 小时前
2.3 Flink的核心概念解析
数据库·python·flink
-Xie-1 小时前
Maven(三)
python·pycharm·maven
WSSWWWSSW1 小时前
Seaborn数据可视化实战:Seaborn颜色与样式定制教程
python·信息可视化·seaborn
Boxsc_midnight2 小时前
【适合中小企业应用的Flask网站部署指南】【小白指南系列】如何在Windows Server服务器上部署Flask网站和SSL证书开启HTTPS
服务器·windows·python·flask
码界筑梦坊3 小时前
173-基于Flask的微博舆情数据分析系统
后端·python·数据分析·flask·毕业设计
nightunderblackcat4 小时前
新手向:异步编程入门asyncio最佳实践
前端·数据库·python
weixin_448617054 小时前
疏老师-python训练营-Day54Inception网络及其思考
python