当前位置: 首页 > news >正文

一下成都网站建设公司/品牌运营管理有限公司

一下成都网站建设公司,品牌运营管理有限公司,腾讯企业邮箱入口登陆,焦溪翠冠梨做的网站使用命令sudo pip3 install matplotlib已知报错,用同样的命令安装numpy和opencv却没有,因此重装linux系统两次都没有解决(我是在Vmware中创建的)。报错如下: rognubuntu:~$sudo pip3 install matplotlib Collecting n…

使用命令sudo pip3 install matplotlib已知报错,用同样的命令安装numpy和opencv却没有,因此重装linux系统两次都没有解决(我是在Vmware中创建的)。报错如下:

rogn@ubuntu:~$sudo  pip3 install matplotlib
Collecting numpy
Exception:
Traceback (most recent call last):File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connection.py", line 137, in _new_conn(self.host, self.port), self.timeout, **extra_kw)File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/connection.py", line 91, in create_connectionraise errFile "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/connection.py", line 81, in create_connectionsock.connect(sa)
OSError: [Errno 101] Network is unreachableDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 560, in urlopenbody=body, headers=headers)File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 346, in _make_requestself._validate_conn(conn)File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 787, in _validate_connconn.connect()File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connection.py", line 217, in connectconn = self._new_conn()File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connection.py", line 146, in _new_connself, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f3bbaa12198>: Failed to establish a new connection: [Errno 101] Network is unreachableDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 209, in mainstatus = self.run(options, args)File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 328, in runwb.build(autobuilding=True)File "/usr/lib/python3/dist-packages/pip/wheel.py", line 748, in buildself.requirement_set.prepare_files(self.finder)File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 360, in prepare_filesignore_dependencies=self.ignore_dependencies))File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 512, in _prepare_filefinder, self.upgrade, require_hashes)File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 273, in populate_linkself.link = finder.find_requirement(self, upgrade)File "/usr/lib/python3/dist-packages/pip/index.py", line 442, in find_requirementall_candidates = self.find_all_candidates(req.name)File "/usr/lib/python3/dist-packages/pip/index.py", line 400, in find_all_candidatesfor page in self._get_pages(url_locations, project_name):File "/usr/lib/python3/dist-packages/pip/index.py", line 545, in _get_pagespage = self._get_page(location)File "/usr/lib/python3/dist-packages/pip/index.py", line 648, in _get_pagereturn HTMLPage.get_page(link, session=self.session)File "/usr/lib/python3/dist-packages/pip/index.py", line 757, in get_page"Cache-Control": "max-age=600",File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in getreturn self.request('GET', url, **kwargs)File "/usr/lib/python3/dist-packages/pip/download.py", line 378, in requestreturn super(PipSession, self).request(method, url, *args, **kwargs)File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in requestresp = self.send(prep, **send_kwargs)File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in sendr = adapter.send(request, **kwargs)File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in sendresp = super(CacheControlAdapter, self).send(request, **kw)File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in sendtimeout=timeoutFile "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen_stacktrace=sys.exc_info()[2])File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in incrementtotal -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
You are using pip version 8.1.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

可能当时太冲动,没有考虑太多网络问题,仔细看报错,第一个就是。

 

解决方法

网络问题,解决方案很简单,不用官方源改用阿里镜像。命令如下:

sudo pip3 install matplotlib -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

效果如下:

rogn@ubuntu:~$ sudo pip3 install matplotlib -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
The directory '/home/rogn/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/rogn/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting matplotlibDownloading http://mirrors.aliyun.com/pypi/packages/ad/4c/0415f15f96864c3a2242b1c74041a806c100c1b21741206c5d87684437c6/matplotlib-3.0.2-cp35-cp35m-manylinux1_x86_64.whl (12.9MB)100% |████████████████████████████████| 12.9MB 11.4MB/s 
Collecting kiwisolver>=1.0.1 (from matplotlib)Downloading http://mirrors.aliyun.com/pypi/packages/7e/31/d6fedd4fb2c94755cd101191e581af30e1650ccce7a35bddb7930fed6574/kiwisolver-1.0.1-cp35-cp35m-manylinux1_x86_64.whl (949kB)100% |████████████████████████████████| 952kB 27.3MB/s 
Collecting cycler>=0.10 (from matplotlib)Downloading http://mirrors.aliyun.com/pypi/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)Downloading http://mirrors.aliyun.com/pypi/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl (61kB)100% |████████████████████████████████| 71kB 14.8MB/s 
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.10.0 in /usr/local/lib/python3.5/dist-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=2.1 in /usr/local/lib/python3.5/dist-packages (from matplotlib)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python3/dist-packages (from kiwisolver>=1.0.1->matplotlib)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python3/dist-packages (from cycler>=0.10->matplotlib)
Installing collected packages: kiwisolver, cycler, pyparsing, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-3.0.2 pyparsing-2.3.1
You are using pip version 8.1.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

就是网络慢,有时候可以慢速下载,有时直接连接失败, 好像科学上网也不行,不知道pip3的--timeout选项变大点会不会好点。(不吐槽了,换源大法好!

 

Windows下同样的问题

当出现这一问题,我的Visual Studio 2017的Python3板块下使用命令pip3 install matplotlib也出错,报错如下:

C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64>pip3 install matplotlib
Collecting matplotlibRetrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/matplotlib/Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/matplotlib/Using cached https://files.pythonhosted.org/packages/b1/56/569c83515c10146fd0aa09e086816b12e301d0811048e3354a6e9b77ba9a/matplotlib-3.0.2-cp36-cp36m-win_amd64.whl
Requirement already satisfied: numpy>=1.10.0 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from matplotlib) (1.16.1)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)Could not find a version that satisfies the requirement pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib) (from versions: )
No matching distribution found for pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)
You are using pip version 19.0.2, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

同样也是网络问题,用上面同样的方法:

C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64>pip install matplotlib -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting matplotlibDownloading http://mirrors.aliyun.com/pypi/packages/b1/56/569c83515c10146fd0aa09e086816b12e301d0811048e3354a6e9b77ba9a/matplotlib-3.0.2-cp36-cp36m-win_amd64.whl (8.9MB)100% |████████████████████████████████| 8.9MB 11.4MB/s
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)Downloading http://mirrors.aliyun.com/pypi/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl (61kB)100% |████████████████████████████████| 71kB 3.8MB/s
Collecting cycler>=0.10 (from matplotlib)Downloading http://mirrors.aliyun.com/pypi/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Requirement already satisfied: numpy>=1.10.0 in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from matplotlib) (1.16.1)
Collecting python-dateutil>=2.1 (from matplotlib)Downloading http://mirrors.aliyun.com/pypi/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl (226kB)100% |████████████████████████████████| 235kB 17.1MB/s
Collecting kiwisolver>=1.0.1 (from matplotlib)Downloading http://mirrors.aliyun.com/pypi/packages/44/72/16630c3392eba03788ad87949390516bbc488e8e118047a3b824631d21a6/kiwisolver-1.0.1-cp36-none-win_amd64.whl (57kB)100% |████████████████████████████████| 61kB 5.6MB/s
Collecting six (from cycler>=0.10->matplotlib)Downloading http://mirrors.aliyun.com/pypi/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages (from kiwisolver>=1.0.1->matplotlib) (40.8.0)
Installing collected packages: pyparsing, six, cycler, python-dateutil, kiwisolver, matplotlib
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'c:\\program files (x86)\\microsoft visual studio\\shared\\python36_64\\Lib\\site-packages\\pyparsing.py'
Consider using the `--user` option or check the permissions.You are using pip version 19.0.2, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

 

附加:

  1. 阿里云 http://mirrors.aliyun.com/pypi/simple/
  2. 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
  3. 豆瓣(douban) http://pypi.douban.com/simple/
  4. 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

 

 

参考链接:https://blog.csdn.net/qq_25964837/article/details/80295041

转载于:https://www.cnblogs.com/lfri/p/10425052.html

http://www.jmfq.cn/news/4991311.html

相关文章:

  • 长春seo整站优化/上海企业网站seo
  • 做网站需要哪方面的编程/挖掘关键词爱站网
  • B2B网站做不出排名跟流量/百度提交入口网站
  • 白城网站建设公司/情感营销的十大案例
  • 石家庄高端网站建设/手机网站模板免费下载
  • 惠州制作网站软件/岳阳网站设计
  • 深圳市工程交易服务网/沈阳沈河seo网站排名优化
  • 新产品开发流程图/楚雄seo
  • 网站开发都是用什么做的/网络推广方式主要有
  • 一个网站如何做双语/网络广告是什么
  • 珠海网站制作套餐/互联网项目推广平台有哪些
  • wordpress菜单特效/武汉百度推广seo
  • 汕头企业做网站/怎么样推广自己的产品
  • php p2p网站建设/百度网盘搜索引擎盘多多
  • 做网站优化推广多少钱/网络营销最基本的应用方式是什么
  • wordpress网站测速/企业网址怎么申请
  • 长沙seo计费管理/北京网站优化专家
  • wordpress附件分离/seo和sem哪个工资高
  • 泰安选择企业建站公司/seo和sem的联系
  • 深圳市手机网站建设报价/网络推广公司运作
  • win本地网站建设/网络推广员具体做什么的
  • 网站标题在线制作/美国最新消息今天 新闻
  • 58同城建网站怎么做/windows优化大师和360哪个好
  • 做展板好的网站/2024年新冠疫情最新消息今天
  • 要维护公司的网站该怎么做/今日小说排行榜
  • 乐清做网站的/品牌营销策略包括哪些内容
  • 做百度推广/seo团队
  • 淮安市广德育建设网站/怎么联系地推公司
  • 成熟的网站怎么做seo推广/品牌软文范文
  • 公司网站设计案例/今日新闻快讯