当前位置:网站首页>[tools] related use of PIP and CONDA

[tools] related use of PIP and CONDA

2022-06-22 18:06:00 Hard working yuan

conda Related use of

0. Set up domestic image
http://Anaconda.org Our server is abroad , Install multiple packages when ,conda Downloads are often slow . tsinghua TUNA What are the mirror sources Anaconda The image of the warehouse , Add it to conda Can be configured :
add to Anaconda Of TUNA Mirror image

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

TUNA Of help The image address is quoted in , Need to get rid of it.
Set the channel address when searching

conda config --set show_channel_urls yes

1. View the existing virtual environment name

conda env list

2. Creating a virtual environment

conda create -n env_name python=3.8

3. Activate the virtual environment

activate env_name

4. View installed packages

conda list 
#  Specify to view the... Installed in an environment package
conda list -n env_name

5. Close the virtual environment

deactivate

6. Remove environment

conda remove -n env_name --all

7. Reduce python Methods :
open anaconda prompt, Then input conda install python=3.6

8.conda Create an environment

conda create --name  Name of the environment  pytohn==3.6 

9. Activate the environment

activate yourEnv

10. Delete environment

conda env remove -n yourEnv

11. Look at all the environments

conda env list
 or 
conda info --envs

pip Related use of

0. Library updates and Downloads

pip install -U numpy
conda install module  ( Suggest using pip download )
pip install --upgrade module -i https://pypi.tuna.tsinghua.edu.cn/simple
python -m pip install module -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com(√)
pip install module -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com(√)
pip install -i https://pypi.douban.com/simple/ module #  Use Douban source 
pip install -i http://mirrors.aliyun.com/pypi/simple/ module  #  Alibaba cloud  
pip install -i  https://pypi.mirrors.ustc.edu.cn/simple/ module  #  University of science and technology of China  
pip install -i  http://pypi.douban.com/simple/ module  #  douban (douban) 
pip install -i  https://pypi.tuna.tsinghua.edu.cn/simple/ module  #  Tsinghua University  
pip install -i  http://pypi.mirrors.ustc.edu.cn/simple/ module  #  University of science and technology of China 

1.pip Install the version of the specified library
pip install numpy==2.8.7

原网站

版权声明
本文为[Hard working yuan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221627411129.html