Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install error #198

Closed
W-Lawless opened this issue Jan 5, 2020 · 5 comments
Closed

install error #198

W-Lawless opened this issue Jan 5, 2020 · 5 comments

Comments

@W-Lawless
Copy link

W-Lawless commented Jan 5, 2020

Hi guys, trying to use your template project to learn how to create a simple sandbox, I'm getting this error after running

pip install -r -requirements.txt

` ERROR: Command errored out with exit status 1:
command: ~/flaskPython/env/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/setup.py'"'"'; file='"'"'/private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/pip-egg-info
cwd: /private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/
Complete output (23 lines):
running egg_info
creating /private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/pip-egg-info/psycopg2.egg-info
writing /private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to /private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to /private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file '/private/var/folders/5j/b27k95js4rg4g4byh2glxhwc0000gn/T/pip-install-QYde2H/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt'

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).

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

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.`

@Naveenkhasyap
Copy link

Install libpq-dev using this cmd this should fix the issue , rerun the pip install requirements cmd once you do this . sudo apt-get install libpq-dev

@abhisuri97
Copy link
Contributor

Following up: Is this fixed?

@W-Lawless
Copy link
Author

I'm using Mac OS -- I used homebrew to install libpq package

`==> libpq
libpq is keg-only, which means it was not symlinked into /usr/local,
because conflicts with postgres formula.

If you need to have libpq first in your PATH run:
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.bash_profile

For compilers to find libpq you may need to set:
export LDFLAGS="-L/usr/local/opt/libpq/lib"
export CPPFLAGS="-I/usr/local/opt/libpq/include"
`

This did fix error in OP; but new issue arises after pip install -r requirements.txt

ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.14_3/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/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.14_3/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/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.14_3/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/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.14_3/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/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.14_3/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/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/local/Cellar/python@2/2.7.14_3/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 <module> from pip._internal.main import main File "/usr/local/lib/python2.7/site-packages/pip/_internal/main.py", line 13, in <module> from pip._internal.cli.autocompletion import autocomplete File "/usr/local/lib/python2.7/site-packages/pip/_internal/cli/autocompletion.py", line 11, in <module> from pip._internal.cli.main_parser import create_main_parser File "/usr/local/lib/python2.7/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module> from pip._internal.cli import cmdoptions File "/usr/local/lib/python2.7/site-packages/pip/_internal/cli/cmdoptions.py", line 25, in <module> from pip._internal.locations import USER_CACHE_DIR, get_src_prefix File "/usr/local/lib/python2.7/site-packages/pip/_internal/locations.py", line 18, in <module> from pip._internal.utils import appdirs File "/usr/local/lib/python2.7/site-packages/pip/_internal/utils/appdirs.py", line 16, in <module> from pip._internal.utils.compat import WINDOWS, expanduser File "/usr/local/lib/python2.7/site-packages/pip/_internal/utils/compat.py", line 17, in <module> from pip._vendor.urllib3.util import IS_PYOPENSSL File "/usr/local/lib/python2.7/site-packages/pip/_vendor/urllib3/__init__.py", line 7, in <module> from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url File "/usr/local/lib/python2.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 29, in <module> from .connection import ( File "/usr/local/lib/python2.7/site-packages/pip/_vendor/urllib3/connection.py", line 40, in <module> from .util.ssl_ import ( File "/usr/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/__init__.py", line 7, in <module> from .ssl_ import ( File "/usr/local/lib/python2.7/site-packages/pip/_vendor/urllib3/util/ssl_.py", line 8, in <module> from hashlib import md5, sha1, sha256 ImportError: cannot import name md5

Is this library built for linux ? anyway to get working on mac ?

@abhisuri97
Copy link
Contributor

Yeah that library is built for linux. Try doing brew install postgresql

@abhisuri97
Copy link
Contributor

Closing unless there are other issues. Feel free to reopen as you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants