Skip to content
This repository has been archived by the owner. It is now read-only.

major python problems #48301

Closed
ryanGT opened this issue Jan 20, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@ryanGT
Copy link

commented Jan 20, 2016

I sent this to the mailing list (librelist.com) but I get the impression that list isn't active. I hope this is the right place to ask for help.

I recently did a brew update and then tried to upgrade sympy via pip. Now my python installation is majorly broken. Almost anything python related that I try to do results in this traceback:

rkrauss|krauss_syllabi$ pip install hashlib

ERROR:root:code for hash md5 was not found.

Traceback (most recent call last):

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in

globals()[__func_name] = __get_hash(__func_name)

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor

raise ValueError('unsupported hash type ' + name)

ValueError: unsupported hash type md5

ERROR:root:code for hash sha1 was not found.

Traceback (most recent call last):

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in

globals()[__func_name] = __get_hash(__func_name)

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor

raise ValueError('unsupported hash type ' + name)

ValueError: unsupported hash type sha1

ERROR:root:code for hash sha224 was not found.

Traceback (most recent call last):

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in

globals()[__func_name] = __get_hash(__func_name)

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor

raise ValueError('unsupported hash type ' + name)

ValueError: unsupported hash type sha224

ERROR:root:code for hash sha256 was not found.

Traceback (most recent call last):

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in

globals()[__func_name] = __get_hash(__func_name)

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor

raise ValueError('unsupported hash type ' + name)

ValueError: unsupported hash type sha256

ERROR:root:code for hash sha384 was not found.

Traceback (most recent call last):

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in

globals()[__func_name] = __get_hash(__func_name)

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor

raise ValueError('unsupported hash type ' + name)

ValueError: unsupported hash type sha384

ERROR:root:code for hash sha512 was not found.

Traceback (most recent call last):

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in

globals()[__func_name] = __get_hash(__func_name)

File "/usr/local/Cellar/python/2.7.10_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor

raise ValueError('unsupported hash type ' + name)

ValueError: unsupported hash type sha512

Traceback (most recent call last):

File "/usr/local/bin/pip", line 7, in

from pip import main

File "/usr/local/lib/python2.7/site-packages/pip/init.py", line 15, in

from pip.vcs import git, mercurial, subversion, bazaar  # noqa

File "/usr/local/lib/python2.7/site-packages/pip/vcs/mercurial.py", line 10, in

from pip.download import path_to_url

File "/usr/local/lib/python2.7/site-packages/pip/download.py", line 38, in

from pip._vendor import requests, six

File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/init.py", line 58, in

from . import utils

File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/utils.py", line 26, in

from .compat import parse_http_list as _parse_list_header

File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/compat.py", line 7, in

from .packages import chardet

File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/init.py", line 3, in

from . import urllib3

File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/init.py", line 10, in

from .connectionpool import (

File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 31, in

from .connection import (

File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/connection.py", line 45, in

from .util.ssl_ import (

File "/usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/init.py", line 5, in

from .ssl_ import (

File "/usr/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py", line 2, in

from hashlib import md5, sha1, sha256

ImportError: cannot import name md5

Trying to run brew update now results in this:

error: unable to unlink old 'Library/ENV/pkgconfig/10.11/libcurl.pc' (Permission denied)

error: unable to unlink old 'Library/ENV/pkgconfig/10.11/libxml-2.0.pc' (Permission denied)

error: unable to unlink old 'Library/ENV/pkgconfig/10.11/sqlite3.pc' (Permission denied)

Error: Failure while executing: git pull --ff --no-rebase --quiet origin refs/heads/master:refs/remotes/origin/master

I went in and changed the owner of all .pc files in that folder to me and even did a chmod 777. I still get that error with brew update.

Here is the output of brew doctor. I don't think these are critical:

rkrauss|10.11[master*]$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:
docbook-xsl
unison240

Warning: Xcode 7 lacks the 10.10 SDK which can cause some builds to fail.
We recommend installing the Command Line Tools with:
xcode-select --install
to resolve this issue.

How do I get python working again?

Thanks,

Ryan

@tdsmith

This comment has been minimized.

Copy link
Contributor

commented Jan 21, 2016

You will need to:

  • reset permissions on /usr/local with e.g. sudo chown -R $USER /usr/local
  • install the Xcode Command-Line Tools with xcode-select --install
  • run brew update
  • run brew reinstall python
@ryanGT

This comment has been minimized.

Copy link
Author

commented Jan 21, 2016

Thanks for the help. brew update now seems to finish cleanly.

Having trouble with brew reinstall python:

rkrauss|usr$ brew reinstall python
==> Reinstalling python with --universal
Error: No available formula with the name "homebrew/dupes/tcl-tk"
Please tap it and then try again: brew tap homebrew/dupes

@tdsmith

This comment has been minimized.

Copy link
Contributor

commented Jan 21, 2016

This is good advice:

Please tap it and then try again: brew tap homebrew/dupes

@ryanGT

This comment has been minimized.

Copy link
Author

commented Jan 21, 2016

I didn't realize that was a verbatim command. Trying that now.

@bfontaine bfontaine added the python label Jan 21, 2016

@ryanGT

This comment has been minimized.

Copy link
Author

commented Jan 21, 2016

Things seem to be fixed. Thank you very much.

@ryanGT ryanGT closed this Jan 21, 2016

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.