Issues related to using Anaconda and Pip

Source: Internet
Author: User
issues related to using Anaconda and Pip

I use Anaconda as the management tool for Ipython environment Anaconda download slow way Conda Environment Management change PIP source to domestic mirror anaconda download speed is slow

Run on the command line using the Tsinghua mirror server:

Conda config--add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
Conda config--set show_ Channel_urls Yes
Environmental management of Conda

Conda's environmental management capabilities allow us to install several different versions of Python at the same time and to switch freely. For the above installation process, assuming that we are using the Python 2.7 corresponding installation package, then Python 2.7 is the default environment (the default name is root, and note that this root is not meant for super administrators).

Suppose we need to install Python 3.5 on the command line:

# Create an environment named Python34 that specifies the Python version is 3.4 (3.4.x,conda will automatically find the latest version of 3.4.x for us)
Conda create--name python34 python=3.4

# After installation, use activate to activate an environment
activate Python34 # for Windows
source activate Python34 # for Linux & Mac
# After activation, you will find that terminal input more python34 words, in fact, at this time the system is to do is to remove the default 2.7 environment from the path, and then 3.4 corresponding command to join the path

# at this time, again input
python-- Version
# can get ' Python 3.4.5:: Anaconda 4.1.1 (64-bit) ', that the system has switched to 3.4 of the Environment

# if you want to return to the default Python 2.7 environment, run
Deactivate Python34 # for Windows
source Deactivate Python34 # for Linux & Mac

# Delete an existing environment
Conda remove --name Python34--all

The different Python environments that users install are placed under the directory ~/anaconda/envs and can be run Conda INFO-E view the installed environment in the command, and an asterisk or parenthesis is displayed in the currently activated environment. change Pip source to domestic mirror

You often need to install a variety of modules when using Python, and the PIP is a very powerful module installation tool, but because the foreign official pypi often be wall, cause is not available, so we'd better be using their own PIP source change, so that can solve the wall caused by the trouble of the library.
There are many sources available on the web, such as watercress: http://pypi.douban.com/simple/
Tsinghua: Https://pypi.tuna.tsinghua.edu.cn/simple
Recently used more and more conveniently is the PIP source of Tsinghua University, it is the official website PyPI Mirror, sync every 5 minutes, address for https://pypi.tuna.tsinghua.edu.cn/simple temporary use:

You can add parameters I-https://pypi.tuna.tsinghua.edu.cn/simple when using the PIP
For example: Pip install-i https://pypi.tuna.tsinghua.edu.cn/simple gevent, this will be from the Tsinghua side of the mirror to install Gevent library. Permanently modified, once and for all:

Under Linux, modify ~/.pip/pip.conf (without creating one), modify Index-url to Tuna, as follows:

[Global]
Index-url = Https://pypi.tuna.tsinghua.edu.cn/simple

Under Windows, create a PIP directory directly in the user directory, such as: C:\Users\xx\pip, new file Pip.ini, as follows:

[Global]
 Index-url = Https://pypi.tuna.tsinghua.edu.cn/simple
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.