python pip 更改国内镜像源
-
- 以如下方式临时使用:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple scipy==0.13.3
- 2.永久修改
创建vim ~/.pip/pip.conf
http://mirrors.aliyun.com/pypi/simple/
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com
1. install anaconda
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
ref: https://www.jianshu.com/p/edaa744ea47d
- config:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
- 显示安装的频道
conda config --set show_channel_urls yes
- 查看已经添加的channels
conda config --get channels
- 已添加的channel在哪里查看
vim ~/.condarc
2. django
https://docs.djangoproject.com/en/3.1/intro/install/
Installing an official release with pip
ref: https://docs.djangoproject.com/en/3.1/topics/install/#installing-development-version
python -m pip install Django
Installing the development version
ref: https://docs.djangoproject.com/en/3.1/topics/install/#installing-development-version
-
Make sure that you have Git installed and that you can run its commands from a shell. (Enter git help at a shell prompt to test this.)
-
Check out Django’s main development branch like so:
$ git clone https://github.com/django/django.git
This will create a directory django in your current directory.
3.Make sure that the Python interpreter can load Django’s code. The most convenient way to do this is to use a virtual environment and pip. The contributing tutorial walks through how to create a virtual environment.
4.After setting up and activating the virtual environment, run the following command:
$ python -m pip install -e django/
This will make Django’s code importable, and will also make the django-admin utility command available. In other words, you’re all set!