MacBookPro:~ mac$ pip install numpy
Collecting numpy
  Downloading numpy-1.13.1-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.5MB)
    32% |██████████▎                     | 1.5MB 10kB/s eta 0:04:49Exception:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 232, in _error_catcher
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 314, in read
    data = self._fp.read(amt)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 60, in read
    data = self.__fp.read(amt)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 448, in read
    n = self.readinto(b)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 488, in readinto
    n = self.fp.readinto(b)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 575, in readinto
    return self._sock.recv_into(b)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 929, in recv_into
    return self.read(nbytes, buffer)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 791, in read
    return self._sslobj.read(len, buffer)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py", line 575, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/download.py", line 821, in unpack_url
    hashes=hashes
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/download.py", line 659, in unpack_http_url
    hashes)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/download.py", line 882, in _download_http_url
    _download_url(resp, link, content_file, hashes)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/download.py", line 603, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/utils/hashes.py", line 46, in check_against_chunks
    for chunk in chunks:
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/download.py", line 571, in written_chunks
    for chunk in chunks:
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/utils/ui.py", line 139, in iter
    for x in it:
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/download.py", line 560, in resp_read
    decode_content=False):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 357, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 324, in read
    flush_decoder = True
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 237, in _error_catcher
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.

解决方法

通过pip安装numpy的时候,可能会报上面的错误,大陆通过FQ手段,是可能解决该问题的。下面给个不用FQ的办法。
使用国内镜像下载python库的办法。

终端输入命令

pip  install --index https://pypi.mirrors.ustc.edu.cn/simple/ pandas  

MacBookPro:~ mac$ pip  install --index https://pypi.mirrors.ustc.edu.cn/simple/ pandas
Collecting pandas
  Downloading https://mirrors.ustc.edu.cn/pypi/web/packages/1a/99/253f7096b12481941623205fc81e67aaf86c1e0d17026d286b53da799fd2/pandas-0.20.3-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (14.7MB)
    100% |████████████████████████████████| 14.7MB 48kB/s
Collecting pytz>=2011k (from pandas)
  Downloading https://mirrors.ustc.edu.cn/pypi/web/packages/55/62/e7cd0e15b76062d298413f14bb4ec3cd8568a22d274427f9c3c7286969f4/pytz-2017.2-py2.py3-none-any.whl (484kB)
    100% |████████████████████████████████| 491kB 1.1MB/s
Collecting python-dateutil>=2 (from pandas)
  Downloading https://mirrors.ustc.edu.cn/pypi/web/packages/4b/0d/7ed381ab4fe80b8ebf34411d14f253e1cf3e56e2820ffa1d8844b23859a2/python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 988kB/s
Collecting numpy>=1.7.0 (from pandas)
  Downloading https://mirrors.ustc.edu.cn/pypi/web/packages/d9/aa/850b4461a43bbd1d2ff75c97de4cbae7a06884c5c351c5c2a5cfb796a71b/numpy-1.13.1-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.5MB)
    100% |████████████████████████████████| 4.5MB 169kB/s
Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from python-dateutil>=2->pandas)
Installing collected packages: pytz, python-dateutil, numpy, pandas
Successfully installed numpy-1.13.1 pandas-0.20.3 python-dateutil-2.6.1 pytz-2017.2
MacBookPro:~ mac$ pip install numpy
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages
MacBookPro:~ mac$ cd /Library/F
Filesystems/ Fonts/       Frameworks/
MacBookPro:~ mac$ cd /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site
site-packages/ site.py
MacBookPro:~ mac$ cd /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/
README                           packaging-16.8.dist-info/        pytz/
__pycache__/                     pandas/                          pytz-2017.2.dist-info/
appdirs-1.4.3.dist-info/         pandas-0.20.3.dist-info/         setuptools/
appdirs.py                       pip/                             setuptools-35.0.2.dist-info/
dateutil/                        pip-9.0.1.dist-info/             six-1.10.0.dist-info/
easy_install.py                  pkg_resources/                   six.py
MacBookPro:~ mac$ cd /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/
MacBookPro:site-packages mac$ ls
README              packaging-16.8.dist-info    pytz
__pycache__         pandas              pytz-2017.2.dist-info
appdirs-1.4.3.dist-info     pandas-0.20.3.dist-info     setuptools
appdirs.py          pip             setuptools-35.0.2.dist-info
dateutil            pip-9.0.1.dist-info     six-1.10.0.dist-info
easy_install.py         pkg_resources           six.py
numpy               pyparsing-2.2.0.dist-info   you_get
numpy-1.13.1.dist-info      pyparsing.py            you_get-0.4.652.dist-info
packaging           python_dateutil-2.6.1.dist-info

注:--index后面也可以换成别的镜像,比如http://mirrors.sohu.com/python/

pip 安装出现异常的更多相关文章

  1. [Ubuntu] 解决 pip 安装 lxml 出现 x86_64-linux-gnu-gcc 异常

    安装 pip : $ wget https://bootstrap.pypa.io/get-pip.py ... $ sudo python get-pip.py install 使用 pip 安装/ ...

  2. 解决pip安装时 UnicodeDecodeError 问题

    在装django的时候用pip安装就出现了问题,一大堆的红字,然后联想到很多次用pip安装都以失败告终,于是今天抽空看了看出现问题的原因. 情况如下图:

  3. Python中pip安装问题解决

    用国内镜像通过pip安装python的一些包,有时会出现安装失败, 为什么总是失败?自己操作老标准了,这么简单的几个小步骤还老是出错,不由得让我怀疑是否是撞墙了,可是又懒得买vpn去翻~~一墙,无法代 ...

  4. Python使用pip安装TensorFlow模块

    1.首先确保已经安装python,然后用pip来安装matplotlib模块. 2.进入到cmd窗口下,建议执行python -m pip install -U pip setuptools进行升级. ...

  5. Python使用pip安装Numpy模块

    安装Numpy模块一般有两种安装方法: 一:下载模块对应的.exe文件,直接双击运行安装 二:下载模块对应的.whl文件,使用pip安装 对于exe文件的安装比较简单,都是双击运行,这里就不说了. 这 ...

  6. python 版本及pip安装相关

    python2与python3 由于历史原因,Python有两个大的版本分支,Python2和Python3,又由于一些库只支持某个版本分支,所以需要在电脑上同时安装Python2和Python3,因 ...

  7. pip安装使用详解(转)

    pip类似RedHat里面的yum,安装Python包非常方便.本节详细介绍pip的安装.以及使用方法. 1.pip下载安装 1.1 pip下载   1 # wget "https://py ...

  8. pip安装报错:is not a supported wheel on this platform

    可能的原因1:安装的不是对应python版本的库,下载的库名中cp27代表python2.7,其它同理. 可能的原因2:这个是我遇到的情况(下载的是对应版本的库,然后仍然提示不支持当前平台) 我下载到 ...

  9. 使用pip安装BeautifulSoup4模块

    1.测试是否安装了BeautifulSoup4模块 import bs4 print bs4 执行报错说明没有安装该模块 Traceback (most recent call last): File ...

随机推荐

  1. CSS布局那点事儿

    布局 最开始老的一代网站开发,布局都是通过表格实现的. 这样可以形成规整的网格布局,但是也会带来一定的复杂性.比如想要新增某个页面元素,就有可能要改动整个表格,添加很多无用的行或者列. 后来,衍生出不 ...

  2. PAT天梯赛L2-007 家庭房产

    题目链接:点击打开链接 给定每个人的家庭成员和其自己名下的房产,请你统计出每个家庭的人口数.人均房产面积及房产套数. 输入格式: 输入第一行给出一个正整数N(<=1000),随后N行,每行按下列 ...

  3. Jmeter 线程组、运行次数参数化(转)Jpara1=4 -Jpara2=5

    Jmeter的jmx文件保存了线程数和运行次数等参数,这个参数可以在命令行中传入参数的方式来修改数值 步骤如下 1.生成线程和运行次数的参数 Jmeter选项中函数助手对话框,选中__P参数,这个参数 ...

  4. python中enumerate、xrange、range

    enumerate可以给列表自动生成一列,默认从0开始,自动增长1,可以指定默认开始值 list_product = ["thinkpad","macbook" ...

  5. iptables端口转发规则(内网端口转外网端口)

    需求:外网124.202.173.118需要访问 10.45.225.70的内网54032端口,10.45.225.70服务器有公网地址139.129.109.81将内网地址端口转发到外网地址端口,并 ...

  6. mycat分片规则之分片枚举(sharding-by-intinfile)

    mycat分片规则之分片枚举(sharding-by-intinfile) http://blog.51cto.com/goome/2058959 mycat安装及分片初体验 https://blog ...

  7. strcpy、strncpy、strlen、memcpy、memset、strcat、strncat、strcmp、strncmp,strchr

    1.strcpy #include<stdio.h> #include<assert.h> char *mystrcpy(char *dest, const char *src ...

  8. (转)Xargs用法详解

    Xargs用法详解 原文:http://czmmiao.iteye.com/blog/1949225 简介之所以能用到这个命令,关键是由于很多命令不支持|管道来传递参数,而日常工作中有有这个必要,所以 ...

  9. 学习笔记:MDN的JavaScript

    JavaScript 第一步 什么是JavaScript? 每次当你浏览网页时不只是显示静态信息—— 显示即时更新的内容, 或者交互式的地图,或 2D/3D 图形动画,又或者自动播放视频等,你可以确信 ...

  10. 永洪BI——国内领军的一站式大数据分析平台

    平台: CentOS 类型: 虚拟机镜像 软件包: jdk-7.79-linux yonghongbi.sh basic software big data business intelligence ...