外观
Miniconda配置教程
下载地址:Anaconda官网下载
下载地址:清华大学开源软件镜像站下载
Jupyter 官网:Project Jupyter | Home
参考资料:国内 pip 镜像源换源方法以及 pip 基本操作
参考资料:anaconda | 镜像站使用帮助 | 清华大学开源软件镜像站
参考资料:Anaconda配置国内镜像源_anaconda镜像源配置
参考资料:修改新版Python的pip默认安装路径
参考资料:Python pip install修改默认下载路径
Miniconda 配置
Miniconda 安装 Jupyter Notebook
- 打开
Anaconda Prompt
,安装经典 Jupyter Notebook
pip install notebook
运行 Jupyter Notebook
jupyter notebook
Jupyter Notebook 默认路径
生成 Jupyter Notebook 的配置文件
jupyter notebook --generate-config
生成的配置文件通常在C:\Users\<用户名>\.jupyter\jupyter_notebook_config.py
。
打开配置文件,搜索c.ServerApp.notebook_dir
,修改成需要的路径
c.ServerApp.notebook_dir = 'D:\\Python'
配置 pip 镜像源
永久换源
配置永久使用某个镜像源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
查看当前设置镜像源
pip config list
删除全局设置的镜像源
pip config unset global.index-url
临时换源
pip install package_name -i https://pypi.tuna.tsinghua.edu.cn/simple
常用国内源
清华源
https://mirrors.aliyun.com/pypi/simple
阿里源
https://mirrors.aliyun.com/pypi/simple
中科大源
https://pypi.mirrors.ustc.edu.cn/simple
配置 conda 镜像源
- 配置清华源
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
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/r/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- 配置中科大源
conda config --set show_channel_urls yes
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
- 显示添加的源
conda config --show channels
- 删除指定源
conda config --remove channels 源名称或链接
- 换回默认源
conda config --remove-key channels
修改 pip install 默认下载路径
在安装 Miniconda 进行设置后,下载路径在路径D:\ProgramData\anaconda3\Lib\site-packages
下;而不设置的情况下,下载路径倒是在路径D:\ProgramData\miniconda3\Lib\site-packages
下,即设置路径下。
以下操作在Anaconda
和Python
下进行设置是有效的。
- 找到
site.py
文件,参考路径(安装路径下的Lib
目录下的site.py
文件)
D:\ProgramData\miniconda3\Lib\site.py
- 搜索
USER_SITE
和USER_BASE
,设置路径(按照实际路径设置)
USER_SITE = "D:\ProgramData\miniconda3\Lib\site-packages"
USER_BASE = "D:\ProgramData\miniconda3\Scripts"
- 查看pip默认下载路径
python -m site
- 其它命令
python -m site -help
python -m site --user-site
python -m site --user-base