runpython
python
【Ctrl】+【Z】Exit
Check python version
python --version
Use domestic mirroring
# 临时使用清华的大学开源软件镜像
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
Note that
simple
it cannot be less, ishttps
rather thanhttp
Set as default.
Upgrade pip to the latest version (>=10.0.0) and then configure:
python -m pip install --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
If your network connection to pip's default source is poor, temporarily use this mirror to upgrade pip:
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
Configuring multiple mirror sources
If you want to configure multiple mirror sources to balance the load, you can continue to add origin sites in the following ways after replacing index-url:
pip config set global.extra-index-url "<url1> <url2>..."
Please replace the content within the quotation marks yourself. There needs to be a space between the source addresses.
Move out of domestic mirror source
pip config unset global.index-url
View installed packages
pip list
Install a package, taking numpy as an example
pip install numpy
If the package has been installed, it will be displayed as installed, as follows
Uninstall a package, taking numpy as an example
pip uninstall numpy
View the details of the package, taking numpy as an example
We can also use the show command to display complete information for a given package, which may be useful before uninstalling
pip show numpy
pip upgrades the specified library file **** indicates the library file that needs to be upgraded, just replace it
pip install --upgrade ****
pip install --upgrade **** -i https://pypi.tuna.tsinghua.edu.cn/simple