pip设置和pipenv安装设置
1. pip设置
参考:[python] 修改pip配置文件路径、更改pip源、使用pip安装已经下载的whl文件_更改python的pip路径_ykun089的博客-CSDN博客
#查看pip设置
pip -v config list
设置user\pip\pip.ini文件
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
2. pipenv安装设置
直接pip进行安装
pip install pipenv
pipenv设置镜像存储位置:
1.修改系统变量WORKON_HOME,设置其为"." ,这样进行镜像存储的位置在项目当前目录下
2.修改系统变量PIPENV_CUSTOM_VENV_NAME为venv,镜像的名称就是不是随机的了
创建镜像:
进入到项目位置,创建镜像,如果项目存在requirements.txt依赖文件,产生Pipfile,Pipfile.lock
pipenv shell
Pipfile文件内容:
[[source]]
url = "https://mirrors.aliyun.com/pypi/simple/"
verify_ssl = true
name = "pip_conf_index_global"
[packages]
protobuf = ">=3.19.5,<3.20.1"
transformers = "==4.27.1"
icetk = "*"
cpm-kernels = "*"
torch = ">=1.10"
gradio = "*"
[dev-packages]
[requires]
python_version = "3.10"