0
votes

Os: Mac 10.9 Python ver: 2.7.9 database: postgresql 9.3

I am putting the following command to install psycopg2 in my virtualenv: ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2

I am getting the following error: Traceback (most recent call last): File "/Users/dialynsoto/python_ex/crmeasy/venv/bin/pip", line 7, in from pip import main File "/Users/dialynsoto/python_ex/crmeasy/venv/lib/python2.7/site-packages/pip/init.py", line 13, in from pip.utils import get_installed_distributions, get_prog File "/Users/dialynsoto/python_ex/crmeasy/venv/lib/python2.7/site-packages/pip/utils/init.py", line 18, in from pip.locations import ( File "/Users/dialynsoto/python_ex/crmeasy/venv/lib/python2.7/site-packages/pip/locations.py", line 9, in import tempfile File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 35, in from random import Random as _Random File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 49, in import hashlib as _hashlib File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 138, in _hashlib.openssl_md_meth_names) AttributeError: 'module' object has no attribute 'openssl_md_meth_names'

Any clues ?

1
There's a pure python module for postgres access -- pg8000 -- which does what psycopg2 does, and doesn't require a C compiler. Perhaps try that?hd1

1 Answers

0
votes

Try to find hashlib module within your system. It is likely that you have two modules and the one that is being imported is the wrong one (remove the wrong one if it is the case) or you should simply upgrade your python version.