今天重装了电脑的系统,原先的win10 似乎有些问题,重装后想装回python,发现安装numpy包和pandas包时有些问题。
安装命令
pip install pandas
显示报错:
PS F:\python\Data_Ana\names> pip install pandas
Downloading/unpacking pandas
Cleaning up...
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip\req.py", line 1197, in prepare_files
do_download,
File "C:\Python27\lib\site-packages\pip\req.py", line 1375, in unpack_url
self.session,
File "C:\Python27\lib\site-packages\pip\download.py", line 572, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "C:\Python27\lib\site-packages\pip\download.py", line 433, in _download_url
for chunk in resp_read(4096):
File "C:\Python27\lib\site-packages\pip\download.py", line 421, in resp_read
chunk_size, decode_content=False):
File "C:\Python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 240, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 187, in read
data = self._fp.read(amt)
File "C:\Python27\lib\httplib.py", line 573, in read
s = self.fp.read(amt)
File "C:\Python27\lib\socket.py", line 380, in read
data = self._sock.recv(left)
File "C:\Python27\lib\ssl.py", line 714, in recv
return self.read(buflen)
File "C:\Python27\lib\ssl.py", line 608, in read
v = self._sslobj.read(len or 1024)
SSLError: ('The read operation timed out',)
Storing debug log for failure in C:\Users\Aukuno\pip\pip.log
查了查发现是依赖库和编译器的问题:
python2.7要求电脑配备Ms的Microsoft Visual C++ 2008。
http://www.lfd.uci.edu/~gohlke/pythonlibs/
安装后发现还没有解决问题。
这个时候瞄到Dos控制台显示Ms有专门用于支持python2.7的编译器包,链接在此:
https://www.microsoft.com/en-us/download/details.aspx?id=44266
下载安装后问题解决。