标签:python安装包;pip;setuptools;matplotlib;networkx;numpy;scikit-learn;scipy
安装如下python包
matplotlib (1.3.1) networkx (1.10) numpy (1.8.2) pip (1.5.4) scikit-learn (0.16.1) scipy (0.13.3) setuptools (3.3)
依次执行下面的命令
sudo apt-get install build-essential python-dev python-setuptools python-numpy python-scipy libatlas-dev libatlas3-base sudo apt-get install python-matplotlib sudo apt-get install python-pip
安装scikit-learn错误信息
root@adelababy:~# pip install -U scikit-learn Downloading/unpacking scikit-learn Downloading scikit-learn-0.16.1.tar.gz (7.3MB): 6.8MB downloaded Cleaning up... Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1198, in prepare_files do_download, File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url self.session, File "/usr/lib/python2.7/dist-packages/pip/download.py", line 572, in unpack_http_url download_hash = _download_url(resp, link, temp_location) File "/usr/lib/python2.7/dist-packages/pip/download.py", line 433, in _download_url for chunk in resp_read(4096): File "/usr/lib/python2.7/dist-packages/pip/download.py", line 421, in resp_read chunk_size, decode_content=False): File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 225, in stream data = self.read(amt=amt, decode_content=decode_content) File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 174, in read data = self._fp.read(amt) File "/usr/lib/python2.7/httplib.py", line 573, in read s = self.fp.read(amt) File "/usr/lib/python2.7/socket.py", line 380, in read data = self._sock.recv(left) File "/usr/lib/python2.7/ssl.py", line 341, in recv return self.read(buflen) File "/usr/lib/python2.7/ssl.py", line 260, in read return self._sslobj.read(len) SSLError: The read operation timed out Storing debug log for failure in /root/.pip/pip.log
这个问题的主要原因是下载模块时超时,连了vpn后,使用
root@adelababy:~# pip install -U scikit-learn
没有问题
Successfully installed scikit-learn Cleaning up...
其他解决方法参看:http://www.xuebuyuan.com/1157602.html
安装networkx
wget https://pypi.python.org/packages/source/n/networkx/networkx-1.10.tar.gz#md5=eb7a065e37250a4cc009919dacfe7a9d cd networkx-1.10 python setup.py install
测试一下:
root@adelababy:~/networkx-1.10# pip list matplotlib (1.3.1) networkx (1.10) numpy (1.8.2) pip (1.5.4) scikit-learn (0.16.1) scipy (0.13.3) setuptools (3.3)
Done!
本文出自 “Adela” 博客,谢绝转载!
标签:python安装包;pip;setuptools;matplotlib;networkx;numpy;scikit-learn;scipy
原文地址:http://adelazhu.blog.51cto.com/9455045/1688517