python pip版本更新 mac_mac版pip install --upgrade pip 更新版本出错

报错信息:

➜  ~ sudo  pip install --upgrade pip

Collecting pip

Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)

74% |███████████████████████▊        | 888kB 21kB/s eta 0:00:15Exception:

Traceback (most recent call last):

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/basecommand.py", line 223, in main

status = self.run(options, args)

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/commands/install.py", line 282, in run

requirement_set.prepare_files(finder)

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 334, in prepare_files

functools.partial(self._prepare_file, finder))

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 321, in _walk_req_to_install

more_reqs = handler(req_to_install)

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/req/req_set.py", line 491, in _prepare_file

session=self.session)

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 825, in unpack_url

session,

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 673, in unpack_http_url

from_path, content_type = _download_http_url(link, session, temp_dir)

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 886, in _download_http_url

_download_url(resp, link, content_file)

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 621, in _download_url

for chunk in progress_indicator(resp_read(4096), 4096):

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/utils/ui.py", line 133, in iter

for x in it:

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/download.py", line 586, in resp_read

decode_content=False):

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/response.py", line 307, in stream

data = self.read(amt=amt, decode_content=decode_content)

File "/Library/Python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/response.py", line 267, in read

raise ReadTimeoutError(self._pool, None, 'Read timed out.')

ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.

解决方案:sudo pip  install --index https://pypi.mirrors.ustc.edu.cn/simple/ --upgrade pip

安装MySQLdb-python出错

➜  ~ pip install MySQL-python

Collecting MySQL-python

Using cached MySQL-python-1.2.5.zip

Complete output from command python setup.py egg_info:

sh: mysql_config: command not found

Traceback (most recent call last):

File "", line 1, in

File "/private/var/folders/rj/lcp0d7815kl2v5xh0j4zm6h00000gn/T/pip-build-tD7Et4/MySQL-python/setup.py", line 17, in

metadata, options = get_config()

File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

File "setup_posix.py", line 25, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/rj/lcp0d7815kl2v5xh0j4zm6h00000gn/T/pip-build-tD7Et4/MySQL-python/

解决方案:brew install mysql

sudo pip install MySQL-python

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值