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
Pipenv fails to install psycopg2 #3991
Comments
Not an issue related to pipenv workaround:
|
I am having a similar issue on macOS Mojave 10.14.4.
|
^ Expanding on @robertsutherland I had to run |
@HashRocketSyntax trying if it not works, you(everyone) should consider the bugs of pipenv(and the long-time no-releasing risk) and the benefits of pipenv, then, decide to change to other tool(pip-tools/poetry/or even raw requirements.txt) or keep using this tool |
@menghuu that did not work despite checking all homebrew set config and path + adding more libs, which is why I resorted to piping in |
@frostming can you elaborate why this is not an issue related to pipenv? And why purging virtualenv would make it work? By the way, $ pipenv --rm
Removing virtualenv (/Users/ye/.venvs/server-D2-ixepO)…
$ pipenv install psycopg2-binary
Creating a virtualenv for this project…
Pipfile: /Users/ye/dev/website-react/server/Pipfile
Using /usr/local/bin/python3 (3.7.4) to create virtualenv…
⠧ Creating virtual environment...Already using interpreter /usr/local/opt/python/bin/python3.7
Using base prefix '/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7'
New python executable in /Users/ye/.venvs/server-D2-ixepO/bin/python3.7
Also creating executable in /Users/ye/.venvs/server-D2-ixepO/bin/python
Installing setuptools, pip, wheel...
done.
Running virtualenv with interpreter /usr/local/bin/python3
✔ Successfully created virtual environment!
Virtualenv location: /Users/ye/.venvs/server-D2-ixepO
Installing psycopg2-binary…
Adding psycopg2-binary to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock (49ca5b) out of date, updating to (2a2c3b)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✘ Locking Failed!
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/lib/python3.7/site-packages/pipenv/resolver.py", line 69, in resolve
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches google-cloud-python
[pipenv.exceptions.ResolutionFailure]: No versions found
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches google-cloud-python
No versions found
Was https://pypi.org/simple reachable?
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches google-cloud-python
[pipenv.exceptions.ResolutionFailure]: No versions found
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches google-cloud-python
No versions found
Was https://pypi.org/simple reachable? |
I heard good things about Pipenv so I thought of giving a go but ran into the issue installing psycopg2 described by others above. I guess I am back to venv and pip but will try again Pipenv in a few months. |
@ye Sorry for the late reply Purging virtualenv is to fix any potential breakage of the venv.
But your output is about another package |
I've been using |
From psycopg installation page:
Psycopg devs have already made their point that they won't be fixing this: Did anyone find a way to fix this without running additional build steps? |
Exporting some flags as per this thread worked for me!
|
installing dependencies solved it for me $ sudo apt-get install libpq-dev |
@pawelrubin my issue was filed for macOS not on linux as you can see in the log: 'platform_system': 'Darwin'. |
@ye then you should take either of the following solutions:
|
@frostming yes it was due to a openssl lib linking issue while compiling psycopg2 from source. Thanks. Both 1 and 2 work now after I upgrade to python 3.8 and installing psychopg2 version 2.8.5 but 1 is not a recommended solution as @shaurmanchic pointed out (#3991 (comment))
@vignzpie 's solution worked for me on |
If you're here on Linux mint 19 Cinnamon 4.6.7
|
this also help |
These steps were documented in the GeoDjango Windows installation instructions. |
You saved me ! |
|
Ubuntu 20.04 WSL2 in Windows 10 .. |
Using ubuntu 20.04. with multiple python versions 3.8, 3.7..etc and working in a django project using python 3.7 with pipenv, the following worked for me: Solution: sudo apt-get update
sudo apt-get install libpq-dev python3.7-dev
pipenv install --python=3.7 psycopg2
pipenv shell |
I have the same issue with fedora 35. I have installed |
Who so ever is struggling and is unable to install psycopg2 and can refer to this comment, To install psycopg2 in Mac :
and, It worked for me. |
I updated python version, and it worked fine for me. |
Which version of python are you using ? and did you installed it on mac or windows ? |
I am using Fedora Linux. When I reinstalled the pipenv environment with python 3.10 it worked well. |
The problem is there for mac, I tried installing it on mac with the latest version of python, still it was not working.When I followed the above steps only then it worked. |
Issue description
pipenv install psycopg2
failed, even though thePipfile
andPipfile.lock
files included the entries and hashes for packages.Also I noticed that
pip install psycopg2 also failed
: https://gist.github.com/ye/bf1198cc15d9a6a177bae8bc0fc0aff9#file-pip-install-psycopg2-logAlso after the pip install failure, the pip inside pipenv virtual environment is borked.
Expected result
I expect it should install successfully.
Actual result
https://gist.github.com/ye/bf1198cc15d9a6a177bae8bc0fc0aff9
Steps to replicate
pipenv install psycopg2
$ pipenv --support
Pipenv version:
'2018.11.26'
Pipenv location:
'/usr/local/lib/python3.7/site-packages/pipenv'
Python location:
'/usr/local/opt/python/bin/python3.7'
Python installations found:
3.7.4
:/Users/ye/.venvs/server-D2-ixepO/bin/python3
3.7.4
:/usr/local/bin/python3
3.7.4
:/usr/local/bin/python3.7m
2.7.10
:/usr/bin/python
2.7.10
:/usr/bin/pythonw
2.7.10
:/usr/bin/python2.7
PEP 508 Information:
System environment variables:
TERM_SESSION_ID
SSH_AUTH_SOCK
LC_TERMINAL_VERSION
Apple_PubSub_Socket_Render
COLORFGBG
ITERM_PROFILE
SQLITE_EXEMPT_PATH_FROM_VNODE_GUARDS
XPC_FLAGS
LANG
PWD
SHELL
SECURITYSESSIONID
TERM_PROGRAM_VERSION
TERM_PROGRAM
PATH
LC_TERMINAL
COLORTERM
COMMAND_MODE
TERM
HOME
TMPDIR
USER
XPC_SERVICE_NAME
LOGNAME
__CF_USER_TEXT_ENCODING
ITERM_SESSION_ID
SHLVL
OLDPWD
ZSH
GOPATH
PAGER
LESS
LSCOLORS
VIRTUAL_ENV_DISABLE_PROMPT
WORKON_HOME
PROJECT_HOME
VIRTUALENVWRAPPER_PYTHON
VIRTUALENVWRAPPER_VIRTUALENV
VIRTUALENVWRAPPER_PROJECT_FILENAME
VIRTUALENVWRAPPER_WORKON_CD
VIRTUALENVWRAPPER_SCRIPT
VIRTUALENVWRAPPER_HOOK_DIR
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PIPENV_ACTIVE
VIRTUAL_ENV
_
PIP_SHIMS_BASE_MODULE
PYTHONFINDER_IGNORE_UNSUPPORTED
Pipenv–specific environment variables:
PIPENV_ACTIVE
:1
Debug–specific environment variables:
PATH
:/Users/ye/.venvs/server-D2-ixepO/bin:/Users/ye/.cargo/bin:/usr/local/sbin:/Users/ye/Library/Python/3.7/bin:/Users/ye/bin:/Users/ye/.cargo/bin:/usr/local/sbin:/usr/local/opt/gettext/bin:/Users/ye/Library/Python/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/ye/.cargo/bin:/Users/ye/.poetry/bin
SHELL
:/bin/zsh
LANG
:en_US.UTF-8
PWD
:/Users/ye/website/server
VIRTUAL_ENV
:/Users/ye/.venvs/server-D2-ixepO
Contents of
Pipfile
('/Users/ye/website/server/Pipfile'):Contents of
Pipfile.lock
('/Users/ye/website/server/Pipfile.lock'):The text was updated successfully, but these errors were encountered: