anaconda创建新环境:
conda create -n env_name python=X.X
创建环境报错
UnavailableInvalidChannel: The channel is not accessible or is invalid.
channel name: simple
channel url: https://pypi.tuna.tsinghua.edu.cn/simple
error code: 404
You will need to adjust your conda configuration to proceed.
Use conda config --show channels
to view your configuration’s current state,
and use conda config --show-sources
to view config file locations.
由于之前手动安装过国内镜像源,所以考虑到镜像源不工作。
解决方法选自:https://blog.youkuaiyun.com/qq_41897154/article/details/116429352
conda config --remove-key channels
conda config --show channels
conda install tqdm
激活环境
activate env_name
python包:https://www.lfd.uci.edu/~gohlke/pythonlibs/
安装对应环境的包
conda install -n env_name package_name
本地安装
pip install C:\Users\xxx\Downloads\aaa.whl
更新包
pip install --upgrade xxx
卸载包
pip uninstall xxx
虚拟环境加到jupter
python -m ipykernel install --name paddle
或者
#在虚拟环境下
pip install ipykernel ipython
ipython kernel install --user --name pytorch1.6
pip install --user ipykernel
python -m ipykernel install --user --name=mypytorch
查看所有虚拟环境
conda info -e
删除虚拟环境
conda remove --name env_name --all
返回base
deactivate env_name
跳转其他虚拟环境
# 在命令行中切换到想要的虚拟环境,我这里切换到paddle
conda activate paddle
查看所有包
pip list
查看python版本
python -V
GWR常用包
镜像包
pip install pqi
切换镜像
pip install pqi -i https://pypi.tuna.tsinghua.edu.cn/simple
查看镜像情况
conda config --show channels
#添加清华的源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
#移除镜像
conda config --remove channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
中国科学技术大学 : https://pypi.mirrors.ustc.edu.cn/simple
豆瓣:http://pypi.douban.com/simple/
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/simple/
华中科技大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
百度: https://simple.baidu.com/pypi/s