python pip 安装使用国内镜像源

python pip 安装使用国内镜像源

转 https://www.cnblogs.com/cqliu/p/11131092.html

国内镜像源

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

豆瓣:http://pypi.douban.com/simple/

临时使用

 在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple
例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。

一劳永逸

 Linux下,修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)

内容如下:

1
2
3
4
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

windows下,直接在user目录中创建一个pip目录,如:C:Usersxxpip,新建文件pip.ini。内容同上。

本机win10操作系统,目录:C:UsersDELLAppDataRoamingpippip.ini

遇到的问题

实际使用的时候,一开始使用清华的镜像,在安装时,总是提示

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

换了阿里的镜像之后,问题得到了解决。


Python 使用pip安装OpenCV2

Anaconda介绍、安装及使用教程


Jupyter Notebook无法启动Windows 10

转: https://stackoverflow.com/questions/55330059/jupyter-notebook-does-not-start-windows-10
0

尝试了所有建议的解决方案以从Win 10(v。1803)启动Jupyter Notebook,但未成功:

jupyter notebook --generate-config

然后将文件编辑为:

c.NotebookApp.browser = u'open -a "Google Chrome" %s'

另外,将Chrome设置为默认浏览器。禁用所有防病毒软件和弹出窗口阻止程序

我仍然只得到:

copy and paste one of these URLs:
    http://localhost:8888/?token=5fd225a5087b52cfe92b77bc3b74ba539c2f9058b928c283

然后我得到:

http://localhost:8888/tree

和下面的空白页

有趣的是,在Safari(使用Mac)中,启动Jupyter笔记本电脑没有任何问题。似乎只有Windows的问题

Anaconda也不启动(也从图标启动)。这是一个全新的安装

请帮忙

PS。曾尝试解决此问题(https://github.com/jupyter/notebook/issues/4303),但我认为它没有得到解决

0

似乎有多个问题阻止了Notebook的启动。不一定按重要性顺序排列:

  1. 清理浏览器中的缓存

  2. 安装node.JS并升级到最新版本

    pip安装nodejs

  3. 安装npm(https://www.npmjs.com/package/node-gyp0)并升级到最新版本(https://www.taniarascia.com/how-to-install-and-use-node-js-和-npm-mac-and-windows /

此外,似乎最新版本的Notebook自2018年12月起出现问题。因此:

pip uninstall notebook
pip install notebook==5.7.5

对我而言,v 5.7.5(而不是5.7.6)正在运行,但您可能需要降低到5.6.x

同样,这只是Win 10问题。Mac OS工作正常


jupyter 开启时,报404,连接python 失败

更换浏览器,有机会解决问题:

=============================================================================

修改 jupyter notebook 默认浏览器:

          方案:1、打开文件 jupyter_notebook_config.py (C:UsersAdministrator.jupyter 中)

                     2、找到 # c.NotebookApp.browser = ''''

                     3、添加:

                                   import webbrowser

                                   webbrowser.register("chrome", None, webbrowser.GenericBrowser(u"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"))

                                   c.NotebookApp.browser = 'chrome'

============================================================================

原文地址:https://www.cnblogs.com/it-tsz/p/14428091.html