3.6:\Lib\site-packages\pip\models\index.py
# PyPI = Index('https://pypi.python.org/')
# 替换成
PyPI = Index('https://pypi.douban.com/')3.7:\Lib\site-packages\pip\models\index.py
# PyPI = PackageIndex(
# 'https://pypi.org/', file_storage_domain='files.pythonhosted.org'
# )
# 替换成
PyPI = PackageIndex(
'https://pypi.douban.com/', file_storage_domain='files.pythonhosted.org'
)-
- C:\Users[username]\pip
- 新建pip.ini
- 在pip.ini中添加:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
pip3 install jupyter 或 python3 -m pip install jupyter
pip3 install jupyter_contrib_nbextensions 或 python3 -m pip install jupyter_contrib_nbextensions
pip3 install jupyter_contrib_nbextensions安装成功后输入:jupyter contrib nbextension install --user
上述命令三条安装成功后:
cd D:\飞秋数据\视频+课件\Python基础nick
jupyter notebook
补充
添加环境变量是为了cmd输入python能够找到python.exe
python ---> python.exe
pip ---> pip.exe
fatal
python3 -m pip
python相当于手机pip相当于应用商城 install(安装) jupyter(软件)
镜像源:下载软件从一个地方把软件,python默认是去国外的网址上拿,换了个镜像源,以后我们下载东西在国内拿