pip
windows
https://www.lfd.uci.edu/~gohlke/pythonlibs/
阿里镜像源
vim ~/.pip/pip.conf
[global]trusted-host = mirrors.aliyun.com
index-url = https://mirrors.aliyun.com/pypi/simple
导出环境
pip freeze > requirements.txt
安装环境
pip install -r requirements.txt
Linux 安装 Python 后,使用 pip 安装软件包。
默认的 pip 缓存路径是 ~/.cache/pip
但是如果想放到另外的文件夹,则可以执行下列命令:
双引号中,输入自己想保存的路径
pip config set global.cache-dir “/home/pi/udisk/.cache/pip”
会出现一个提示,即修改好了
可以看到,它其实是在用户目录的 .config/pip/ 下创建了一个配置文件,并写入配置
pi@raspberrypi:~ $ pip config set global.cache-dir “/home/pi/udisk/.cache/pip”
Writing to /home/pi/.config/pip/pip.conf
下面即是配置文件
将下面的配置文件直接写入到 ~/.config/pip/pip.conf 也是可以生效的
[global]
cache-dir = /home/pi/udisk/.cache/pip
conda
导出当前环境:
conda env export > pytorch17.yaml
安装环境
根据pytorch17.yaml,在新的机器上创建环境
conda env create -f pytorch17.yaml
error
Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies. Conda may not use the correct pip to install your packages, and they may end up in the wrong place. Please add an ex
在 - pip,前在添加 - pip