Tag Archives: Mac version PIP install

Mac version PIP install — upgrade PIP update version error

Error Message:

➜ ~ 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.

Solution: sudo pip install –index https://pypi.mirrors.ustc.edu.cn/simple/ –upgrade pip

MySQLdb-python Install Error

➜ ~ 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 “<string>”, line 1, in <module>
File “/private/var/folders/rj/lcp0d7815kl2v5xh0j4zm6h00000gn/T/pip-build-tD7Et4/MySQL-python/setup.py”, line 17, in <module>
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/

Solution: brew install mysql

sudo pip install MySQL-python