Pipenv fails locking when installing TensorFlow 2.4.1 - python

2021-02-06: I ended up with installing TensorFlow using pip.
The original question is shown below.
As I mentioned in the title, pipenv fails to lock when installing TensorFlow (ver. 2.4.1).
I would like to know the solution for this problem.
The current environment is:
macOS Big Sur 11.1
python 3.8.7 (pyenv-installed)
pyenv 1.2.22 (homebrew-installed)
pipenv 2020.11.15 (homebrew-installed)
pip 21.0
What I did and responses are:
mkdir ~/tf && cd ~/tf
pyenv local 3.8.7 -> changes to python 3.8.7
pipenv --python 3.8.7 -> creates the virtual environment and Pipfile
pipenv shell
pip install --upgrade pip -> upgrades pip from 20.2.4 to 21.0
pipenv install tensorflow ->
Installing tensorflow...
Adding tensorflow to Pipfile's [packages]...
✔ Installation Succeeded
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✘ Locking Failed!
[ResolutionFailure]: File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/resolver.py", line 741, in _main
[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]: File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/resolver.py", line 702, in resolve_packages
[ResolutionFailure]: results, resolver = resolve(
[ResolutionFailure]: File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/resolver.py", line 684, in resolve
[ResolutionFailure]: return resolve_deps(
[ResolutionFailure]: File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/utils.py", line 1395, in resolve_deps
[ResolutionFailure]: results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]: File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/utils.py", line 1108, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "/usr/local/Cellar/pipenv/2020.11.15/libexec/lib/python3.9/site-packages/pipenv/utils.py", line 833, in resolve
[ResolutionFailure]: raise ResolutionFailure(message=str(e))
[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: Could not find a version that matches tensorflow (from -r /var/folders/66/qc27xk113h97ysq8g96dq6lw0000gn/T/pipenvi9b634u2requirements/pipenv-rgesnhxh-constraints.txt (line 2))
No versions found
Was https://pypi.org/simple reachable?
I tried pipenv lock --clear, but it did not work and returned the same error message above.
It seems that TensorFlow is successfully installed since python -c 'import tensorflow as tf; print(tf.__version__)' returns 2.4.1, and its version supports Python 3.8.7.
I also tried installing TensorFlow using pip outside the virtual environment, and it successfully installed TensorFlow 2.4.1.
Here is the result of pipenv graph and it seems there is no dependency conflict (there might be conflicts that I do not notice).
tensorflow==2.4.1
- absl-py [required: ~=0.10, installed: 0.11.0]
- six [required: Any, installed: 1.15.0]
- astunparse [required: ~=1.6.3, installed: 1.6.3]
- six [required: >=1.6.1,<2.0, installed: 1.15.0]
- wheel [required: >=0.23.0,<1.0, installed: 0.36.2]
- flatbuffers [required: ~=1.12.0, installed: 1.12]
- gast [required: ==0.3.3, installed: 0.3.3]
- google-pasta [required: ~=0.2, installed: 0.2.0]
- six [required: Any, installed: 1.15.0]
- grpcio [required: ~=1.32.0, installed: 1.32.0]
- six [required: >=1.5.2, installed: 1.15.0]
- h5py [required: ~=2.10.0, installed: 2.10.0]
- numpy [required: >=1.7, installed: 1.19.5]
- six [required: Any, installed: 1.15.0]
- keras-preprocessing [required: ~=1.1.2, installed: 1.1.2]
- numpy [required: >=1.9.1, installed: 1.19.5]
- six [required: >=1.9.0, installed: 1.15.0]
- numpy [required: ~=1.19.2, installed: 1.19.5]
- opt-einsum [required: ~=3.3.0, installed: 3.3.0]
- numpy [required: >=1.7, installed: 1.19.5]
- protobuf [required: >=3.9.2, installed: 3.14.0]
- six [required: >=1.9, installed: 1.15.0]
- six [required: ~=1.15.0, installed: 1.15.0]
- tensorboard [required: ~=2.4, installed: 2.4.1]
- absl-py [required: >=0.4, installed: 0.11.0]
- six [required: Any, installed: 1.15.0]
- google-auth [required: >=1.6.3,<2, installed: 1.24.0]
- cachetools [required: >=2.0.0,<5.0, installed: 4.2.1]
- pyasn1-modules [required: >=0.2.1, installed: 0.2.8]
- pyasn1 [required: >=0.4.6,<0.5.0, installed: 0.4.8]
- rsa [required: >=3.1.4,<5, installed: 4.7]
- pyasn1 [required: >=0.1.3, installed: 0.4.8]
- setuptools [required: >=40.3.0, installed: 50.3.2]
- six [required: >=1.9.0, installed: 1.15.0]
- google-auth-oauthlib [required: >=0.4.1,<0.5, installed: 0.4.2]
- google-auth [required: Any, installed: 1.24.0]
- cachetools [required: >=2.0.0,<5.0, installed: 4.2.1]
- pyasn1-modules [required: >=0.2.1, installed: 0.2.8]
- pyasn1 [required: >=0.4.6,<0.5.0, installed: 0.4.8]
- rsa [required: >=3.1.4,<5, installed: 4.7]
- pyasn1 [required: >=0.1.3, installed: 0.4.8]
- setuptools [required: >=40.3.0, installed: 50.3.2]
- six [required: >=1.9.0, installed: 1.15.0]
- requests-oauthlib [required: >=0.7.0, installed: 1.3.0]
- oauthlib [required: >=3.0.0, installed: 3.1.0]
- requests [required: >=2.0.0, installed: 2.25.1]
- certifi [required: >=2017.4.17, installed: 2020.12.5]
- chardet [required: >=3.0.2,<5, installed: 4.0.0]
- idna [required: >=2.5,<3, installed: 2.10]
- urllib3 [required: >=1.21.1,<1.27, installed: 1.26.3]
- grpcio [required: >=1.24.3, installed: 1.32.0]
- six [required: >=1.5.2, installed: 1.15.0]
- markdown [required: >=2.6.8, installed: 3.3.3]
- numpy [required: >=1.12.0, installed: 1.19.5]
- protobuf [required: >=3.6.0, installed: 3.14.0]
- six [required: >=1.9, installed: 1.15.0]
- requests [required: >=2.21.0,<3, installed: 2.25.1]
- certifi [required: >=2017.4.17, installed: 2020.12.5]
- chardet [required: >=3.0.2,<5, installed: 4.0.0]
- idna [required: >=2.5,<3, installed: 2.10]
- urllib3 [required: >=1.21.1,<1.27, installed: 1.26.3]
- setuptools [required: >=41.0.0, installed: 50.3.2]
- six [required: >=1.10.0, installed: 1.15.0]
- tensorboard-plugin-wit [required: >=1.6.0, installed: 1.8.0]
- werkzeug [required: >=0.11.15, installed: 1.0.1]
- wheel [required: >=0.26, installed: 0.36.2]
- tensorflow-estimator [required: >=2.4.0,<2.5.0, installed: 2.4.0]
- termcolor [required: ~=1.1.0, installed: 1.1.0]
- typing-extensions [required: ~=3.7.4, installed: 3.7.4.3]
- wheel [required: ~=0.35, installed: 0.36.2]
- wrapt [required: ~=1.12.1, installed: 1.12.1]
If you have experienced the same issue and solved it, please let me know how to solve this problem.
Thank you.

I don't know if you were able to resolve this. But I was stuck with the same issue.
A simple pipenv clear and then a pipenv sync (which reinstalls dependencies from the pipfile) help resolving the issue
Eventually pip lock was successfull

I've encountered numerous locking issues with pipenv on Big Sur. I've been able to consistently resolve them (including this TF installation issue) by running:
export SYSTEM_VERSION_COMPAT=1
before doing anything with pipenv.
Essentially it makes your shell identify itself as Catalina to pipenv.

I gave up installing TF with Pipenv, instead, I installed TF with pip.
As TF official website suggests, installing TF with pip might be the best solution.
Thank you.

Related

Django - Can't install zappa

I am trying to install zappa for my Django project with the pip install zappa command.
For some reason I am getting the error message:
Collecting kappa==0.6.0
Using cached kappa-0.6.0.tar.gz (29 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[10 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\F\AppData\Local\Temp\pip-install-0z9s37z_\kappa_3e41fa04962841afbbe1bfd266342d06\setup.py", line 54, in <module>
run_setup()
File "C:\Users\F\AppData\Local\Temp\pip-install-0z9s37z_\kappa_3e41fa04962841afbbe1bfd266342d06\setup.py", line 22, in run_setup
long_description=open_file('README.rst').read(),
File "C:\users\F\appdata\local\programs\python\python310\lib\encodings\cp1253.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9c in position 2341: character maps to <undefined>
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I am using Windows 10 and Python 3.10.1 .
[Edit] my pip list results are:
(venv) C:\Users\F>pip list
Package Version
------------------------- ---------
argcomplete 2.0.0
arrow 1.2.1
asgiref 3.5.0
atomicwrites 1.4.0
attrs 21.4.0
awsebcli 3.20.3
binaryornot 0.4.4
boto3 1.21.19
botocore 1.24.19
cement 2.8.2
certifi 2021.10.8
cffi 1.15.0
cfn-flip 1.3.0
chardet 4.0.0
charset-normalizer 2.0.12
click 8.0.4
colorama 0.4.3
cookiecutter 1.7.3
coverage 6.3.2
cryptography 36.0.1
defusedxml 0.7.1
distlib 0.3.4
Django 4.0.3
django-cors-headers 3.11.0
django-countries 7.2.1
django-filter 21.1
django-modeladmin-reorder 0.3.1
django-simple-history 3.0.0
django-tailwind 3.0.1
djangorestframework 3.13.1
djangorestframework-csv 2.1.1
drf-extensions 0.7.1
drf-spectacular 0.21.2
drf-spectacular-sidecar 2022.3.14
durationpy 0.5
factory-boy 3.2.1
Faker 13.3.2
filelock 3.4.2
future 0.18.2
hjson 3.0.2
idna 3.3
inflection 0.5.1
iniconfig 1.1.1
isodate 0.6.1
Jinja2 3.1.2
jinja2-time 0.2.0
jmespath 0.10.0
jsonschema 4.4.0
jwt 1.3.1
Markdown 3.3.6
MarkupSafe 2.0.1
mixer 7.2.2
names-dataset 3.0.2
npm 0.1.1
oauthlib 3.2.0
optional-django 0.1.0
packaging 21.3
pathspec 0.9.0
pendulum 2.1.2
pip 22.0.4
pipenv 2022.1.8
placebo 0.9.0
platformdirs 2.5.2
pluggy 1.0.0
poyo 0.5.0
psycopg2-binary 2.9.3
py 1.11.0
pycountry 22.3.5
pycparser 2.21
Pygments 2.11.2
PyJWT 2.3.0
pymongo 3.11.1
PyPardot 0.1
PyPardotSF 0.1.0
pyparsing 3.0.7
pypiwin32 223
pyrsistent 0.18.1
pytest 7.1.1
pytest-cov 3.0.0
pytest-django 4.5.2
python-dateutil 2.8.2
python-slugify 6.1.1
python3-openid 3.2.0
pytz 2021.3
pytzdata 2020.1
pywin32 303
PyYAML 6.0
requests 2.27.1
requests-oauthlib 1.3.1
s3transfer 0.5.2
semantic-version 2.8.5
setuptools 62.1.0
six 1.16.0
social-auth-app-django 5.0.0
social-auth-core 4.2.0
sqlparse 0.4.2
termcolor 1.1.0
text-unidecode 1.3
toml 0.10.2
tomli 2.0.1
tqdm 4.63.0
troposphere 3.2.2
tzdata 2021.5
unicodecsv 0.14.1
Unidecode 1.3.4
uritemplate 4.1.1
urllib3 1.26.8
virtualenv 20.14.1
virtualenv-clone 0.5.7
wcwidth 0.1.9
Werkzeug 2.0.3
wheel 0.37.1
wsgi-request-logger 0.4.6
xmltodict 0.12.0
With pip pip -V being pip 22.0.4 from C:\Users\F\...\pip (python 3.10)
I haven't found any similar issues online so I could use some help to solve it.

pipenv.exceptions.ResolutionFailure; ERROR: Disabling PEP 517 processing is invalid

I ran into what seems to be a dependency conflict when trying to run pipenv lock but can't seem to figure out what is causing this:
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
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: Disabling PEP 517 processing is invalid: project specifies a build backend of setuptools.build_meta:__legacy__ in pyproject.toml
I tried to debug using the suggested pipenv install --skip-lock and pipenv graph and wasn't able to spot any conflicts in the output below:
bleach==4.1.0
- packaging [required: Any, installed: 21.3]
- pyparsing [required: >=2.0.2,!=3.0.5, installed: 3.0.6]
- six [required: >=1.9.0, installed: 1.16.0]
- webencodings [required: Any, installed: 0.5.1]
bpython==0.21
- curtsies [required: >=0.3.5, installed: 0.3.5]
- blessings [required: >=1.5, installed: 1.7]
- six [required: Any, installed: 1.16.0]
- cwcwidth [required: Any, installed: 0.1.4]
- cwcwidth [required: Any, installed: 0.1.4]
- greenlet [required: Any, installed: 1.1.1]
- pygments [required: Any, installed: 2.10.0]
- pyxdg [required: Any, installed: 0.27]
- requests [required: Any, installed: 2.26.0]
- certifi [required: >=2017.4.17, installed: 2021.5.30]
- charset-normalizer [required: ~=2.0.0, installed: 2.0.4]
- idna [required: >=2.5,<4, installed: 3.2]
- urllib3 [required: >=1.21.1,<1.27, installed: 1.26.6]
coverage==5.5
django-environ==0.6.0
django-extensions==3.1.3
- Django [required: >=2.2, installed: 3.2.7]
- asgiref [required: >=3.3.2,<4, installed: 3.4.1]
- typing-extensions [required: Any, installed: 4.0.0]
- pytz [required: Any, installed: 2021.1]
- sqlparse [required: >=0.2.2, installed: 0.4.2]
django-filter==2.4.0
- Django [required: >=2.2, installed: 3.2.7]
- asgiref [required: >=3.3.2,<4, installed: 3.4.1]
- typing-extensions [required: Any, installed: 4.0.0]
- pytz [required: Any, installed: 2021.1]
- sqlparse [required: >=0.2.2, installed: 0.4.2]
django-nose==1.4.7
- nose [required: >=1.2.1, installed: 1.3.7]
djangorestframework==3.12.4
- django [required: >=2.2, installed: 3.2.7]
- asgiref [required: >=3.3.2,<4, installed: 3.4.1]
- typing-extensions [required: Any, installed: 4.0.0]
- pytz [required: Any, installed: 2021.1]
- sqlparse [required: >=0.2.2, installed: 0.4.2]
eventlet==0.31.1
- dnspython [required: >=1.15.0,<2.0.0, installed: 1.16.0]
- greenlet [required: >=0.3, installed: 1.1.1]
- six [required: >=1.10.0, installed: 1.16.0]
factory-boy==3.2.0
- Faker [required: >=0.7.0, installed: 8.12.1]
- python-dateutil [required: >=2.4, installed: 2.8.2]
- six [required: >=1.5, installed: 1.16.0]
- text-unidecode [required: ==1.3, installed: 1.3]
gunicorn==20.1.0
- setuptools [required: >=3.0, installed: 59.4.0]
locust==2.2.1
- ConfigArgParse [required: >=1.0, installed: 1.5.2]
- flask [required: >=2.0.0, installed: 2.0.1]
- click [required: >=7.1.2, installed: 8.0.1]
- importlib-metadata [required: Any, installed: 4.8.2]
- typing-extensions [required: >=3.6.4, installed: 4.0.0]
- zipp [required: >=0.5, installed: 3.6.0]
- itsdangerous [required: >=2.0, installed: 2.0.1]
- Jinja2 [required: >=3.0, installed: 3.0.1]
- MarkupSafe [required: >=2.0, installed: 2.0.1]
- Werkzeug [required: >=2.0, installed: 2.0.1]
- Flask-BasicAuth [required: >=0.2.0, installed: 0.2.0]
- Flask [required: Any, installed: 2.0.1]
- click [required: >=7.1.2, installed: 8.0.1]
- importlib-metadata [required: Any, installed: 4.8.2]
- typing-extensions [required: >=3.6.4, installed: 4.0.0]
- zipp [required: >=0.5, installed: 3.6.0]
- itsdangerous [required: >=2.0, installed: 2.0.1]
- Jinja2 [required: >=3.0, installed: 3.0.1]
- MarkupSafe [required: >=2.0, installed: 2.0.1]
- Werkzeug [required: >=2.0, installed: 2.0.1]
- Flask-Cors [required: >=3.0.10, installed: 3.0.10]
- Flask [required: >=0.9, installed: 2.0.1]
- click [required: >=7.1.2, installed: 8.0.1]
- importlib-metadata [required: Any, installed: 4.8.2]
- typing-extensions [required: >=3.6.4, installed: 4.0.0]
- zipp [required: >=0.5, installed: 3.6.0]
- itsdangerous [required: >=2.0, installed: 2.0.1]
- Jinja2 [required: >=3.0, installed: 3.0.1]
- MarkupSafe [required: >=2.0, installed: 2.0.1]
- Werkzeug [required: >=2.0, installed: 2.0.1]
- Six [required: Any, installed: 1.16.0]
- gevent [required: >=20.9.0, installed: 21.8.0]
- greenlet [required: >=1.1.0,<2.0, installed: 1.1.1]
- setuptools [required: Any, installed: 59.4.0]
- zope.event [required: Any, installed: 4.5.0]
- setuptools [required: Any, installed: 59.4.0]
- zope.interface [required: Any, installed: 5.4.0]
- setuptools [required: Any, installed: 59.4.0]
- geventhttpclient [required: >=1.5.1, installed: 1.5.1]
- brotli [required: Any, installed: 1.0.9]
- certifi [required: Any, installed: 2021.5.30]
- gevent [required: >=0.13, installed: 21.8.0]
- greenlet [required: >=1.1.0,<2.0, installed: 1.1.1]
- setuptools [required: Any, installed: 59.4.0]
- zope.event [required: Any, installed: 4.5.0]
- setuptools [required: Any, installed: 59.4.0]
- zope.interface [required: Any, installed: 5.4.0]
- setuptools [required: Any, installed: 59.4.0]
- six [required: Any, installed: 1.16.0]
- msgpack [required: >=0.6.2, installed: 1.0.2]
- psutil [required: >=5.6.7, installed: 5.8.0]
- pyzmq [required: >=22.2.1, installed: 22.2.1]
- requests [required: >=2.9.1, installed: 2.26.0]
- certifi [required: >=2017.4.17, installed: 2021.5.30]
- charset-normalizer [required: ~=2.0.0, installed: 2.0.4]
- idna [required: >=2.5,<4, installed: 3.2]
- urllib3 [required: >=1.21.1,<1.27, installed: 1.26.6]
- roundrobin [required: >=0.0.2, installed: 0.0.2]
- Werkzeug [required: >=2.0.0, installed: 2.0.1]
openapi-spec-validator==0.3.1
- jsonschema [required: Any, installed: 3.2.0]
- attrs [required: >=17.4.0, installed: 21.2.0]
- importlib-metadata [required: Any, installed: 4.8.2]
- typing-extensions [required: >=3.6.4, installed: 4.0.0]
- zipp [required: >=0.5, installed: 3.6.0]
- pyrsistent [required: >=0.14.0, installed: 0.18.0]
- setuptools [required: Any, installed: 59.4.0]
- six [required: >=1.11.0, installed: 1.16.0]
- openapi-schema-validator [required: Any, installed: 0.1.5]
- isodate [required: Any, installed: 0.6.0]
- six [required: Any, installed: 1.16.0]
- jsonschema [required: >=3.0.0, installed: 3.2.0]
- attrs [required: >=17.4.0, installed: 21.2.0]
- importlib-metadata [required: Any, installed: 4.8.2]
- typing-extensions [required: >=3.6.4, installed: 4.0.0]
- zipp [required: >=0.5, installed: 3.6.0]
- pyrsistent [required: >=0.14.0, installed: 0.18.0]
- setuptools [required: Any, installed: 59.4.0]
- six [required: >=1.11.0, installed: 1.16.0]
- six [required: Any, installed: 1.16.0]
- PyYAML [required: >=5.1, installed: 5.4.1]
- six [required: Any, installed: 1.16.0]
parameterized==0.8.1
prance==0.21.8.0
- chardet [required: >=3.0,<5.0, installed: 4.0.0]
- requests [required: ~=2.25, installed: 2.26.0]
- certifi [required: >=2017.4.17, installed: 2021.5.30]
- charset-normalizer [required: ~=2.0.0, installed: 2.0.4]
- idna [required: >=2.5,<4, installed: 3.2]
- urllib3 [required: >=1.21.1,<1.27, installed: 1.26.6]
- ruamel.yaml [required: ~=0.17.10, installed: 0.17.16]
- ruamel.yaml.clib [required: >=0.1.2, installed: 0.2.6]
- semver [required: ~=2.13, installed: 2.13.0]
- six [required: ~=1.15, installed: 1.16.0]
psycopg2==2.9.1
pylint-fail-under==0.3.0
- pylint [required: Any, installed: 2.11.1]
- astroid [required: >=2.8.0,<2.9, installed: 2.8.5]
- lazy-object-proxy [required: >=1.4.0, installed: 1.6.0]
- setuptools [required: >=20.0, installed: 59.4.0]
- typed-ast [required: >=1.4.0,<2.0, installed: 1.5.0]
- typing-extensions [required: >=3.10, installed: 4.0.0]
- wrapt [required: >=1.11,<1.14, installed: 1.13.3]
- isort [required: >=4.2.5,<6, installed: 5.10.1]
- mccabe [required: >=0.6,<0.7, installed: 0.6.1]
- platformdirs [required: >=2.2.0, installed: 2.4.0]
- toml [required: >=0.7.1, installed: 0.10.2]
- typing-extensions [required: >=3.10.0, installed: 4.0.0]
This is my Pipfile:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
asgiref = "==3.4.1"
attrs = "==21.2.0"
blessings = "==1.7"
bpython = "==0.21"
certifi = "==2021.5.30"
chardet = "==4.0.0"
charset-normalizer = "==2.0.4"
click = "==8.0.1"
coverage = "==5.5"
curtsies = "==0.3.5"
cwcwidth = "==0.1.4"
django-environ = "==0.6.0"
django-extensions = "==3.1.3"
django-filter = "==2.4.0"
django-nose = "==1.4.7"
djangorestframework = "==3.12.4"
dnspython = "==1.16.0"
eventlet = "==0.31.1"
factory-boy = "==3.2.0"
gevent = "*"
geventhttpclient = "==1.5.1"
greenlet = "==1.1.1"
gunicorn = "==20.1.0"
idna = "==3.2"
isodate = "==0.6.0"
itsdangerous = "==2.0.1"
jsonschema = "==3.2.0"
locust = "==2.2.1"
msgpack = "==1.0.2"
nose = "==1.3.7"
openapi-schema-validator = "==0.1.5"
openapi-spec-validator = "==0.3.1"
parameterized = "==0.8.1"
prance = "==0.21.8.0"
psutil = "==5.8.0"
psycopg2 = "==2.9.1"
pyrsistent = "==0.18.0"
python-dateutil = "==2.8.2"
pytz = "==2021.1"
pyxdg = "==0.27"
pyzmq = "==22.2.1"
requests = "==2.26.0"
roundrobin = "==0.0.2"
"ruamel.yaml" = "==0.17.16"
"ruamel.yaml.clib" = "==0.2.6"
semver = "==2.13.0"
six = "==1.16.0"
sqlparse = "==0.4.2"
text-unidecode = "==1.3"
urllib3 = "==1.26.6"
"zope.event" = "==4.5.0"
"zope.interface" = "==5.4.0"
Brotli = "==1.0.9"
ConfigArgParse = "==1.5.2"
Django = "==3.2.7"
Faker = "==8.12.1"
Flask = "==2.0.1"
Flask-BasicAuth = "==0.2.0"
Flask-Cors = "==3.0.10"
Jinja2 = "==3.0.1"
MarkupSafe = "==2.0.1"
Pygments = "==2.10.0"
PyYAML = "==5.4.1"
Werkzeug = "==2.0.1"
pylint = "*"
pylint-fail-under = "*"
bleach = "*"
[dev-packages]
[requires]
python_version = "3.7"
and the output of pip3 freeze:
asgiref==3.4.1
astroid==2.8.5
attrs==21.2.0
bleach==4.1.0
blessings==1.7
bpython==0.21
Brotli==1.0.9
certifi==2021.5.30
chardet==4.0.0
charset-normalizer==2.0.4
click==8.0.1
ConfigArgParse==1.5.2
coverage==5.5
curtsies==0.3.5
cwcwidth==0.1.4
Django==3.2.7
django-environ==0.6.0
django-extensions==3.1.3
django-filter==2.4.0
django-nose==1.4.7
djangorestframework==3.12.4
dnspython==1.16.0
eventlet==0.31.1
factory-boy==3.2.0
Faker==8.12.1
Flask==2.0.1
Flask-BasicAuth==0.2.0
Flask-Cors==3.0.10
gevent==21.8.0
geventhttpclient==1.5.1
greenlet==1.1.1
gunicorn==20.1.0
idna==3.2
importlib-metadata==4.8.2
isodate==0.6.0
isort==5.10.1
itsdangerous==2.0.1
Jinja2==3.0.1
jsonschema==3.2.0
lazy-object-proxy==1.6.0
locust==2.2.1
MarkupSafe==2.0.1
mccabe==0.6.1
msgpack==1.0.2
nose==1.3.7
openapi-schema-validator==0.1.5
openapi-spec-validator==0.3.1
packaging==21.3
parameterized==0.8.1
platformdirs==2.4.0
prance==0.21.8.0
psutil==5.8.0
psycopg2==2.9.1
Pygments==2.10.0
pylint==2.11.1
pylint-fail-under==0.3.0
pyparsing==3.0.6
pyrsistent==0.18.0
python-dateutil==2.8.2
pytz==2021.1
pyxdg==0.27
PyYAML==5.4.1
pyzmq==22.2.1
requests==2.26.0
roundrobin==0.0.2
ruamel.yaml==0.17.16
ruamel.yaml.clib==0.2.6
semver==2.13.0
six==1.16.0
sqlparse==0.4.2
text-unidecode==1.3
toml==0.10.2
typed-ast==1.5.0
typing_extensions==4.0.0
urllib3==1.26.6
webencodings==0.5.1
Werkzeug==2.0.1
wrapt==1.13.3
zipp==3.6.0
zope.event==4.5.0
zope.interface==5.4.0
how can I resolve the above conflict ?
Not sure if this is the best solution to the problem but the following worked for me:
(ran after exiting the virtenv)
pipenv --rm
pipenv shell
pipenv install --skip-lock --verbose (ran verbose to check for anything fishy)
pipenv lock --pre

GAE/P3 dependency conflicts

I have a GAE standard Python 3 app. When I deploy with
gcloud app deploy app.yaml --project XXX
and this for my requirements.txt:
Werkzeug==1.0.1
Flask==1.1.2
Flask-Login==0.5.0
Flask-WTF==0.14.3
google-cloud-ndb==1.10.5
google-cloud-tasks==2.6.0
firebase-admin==5.0.3
I now get this error:
Updating service [default]...
WARNING: Found incompatible dependencies:
google-cloud-datastore 1.15.3 has requirement google-api-core[grpc]<2.0.0dev,>=1.14.0, but you have google-api-core 2.1.1.
google-cloud-core 1.7.2 has requirement google-api-core<2.0.0dev,>=1.21.0, but you have google-api-core 2.1.1.
google-cloud-core 1.7.2 has requirement google-auth<2.0dev,>=1.24.0, but you have google-auth 2.3.0.
Although my app appears to be working, I'd like to get rid of these errors just in case.
I don't get these errors on my Mac, and nothing requires google-api-core 2.1.1.
The output of pipdeptree | fgrep api-core is:
- google-api-core [required: >=1.22.1,<3.0.0dev, installed: 1.31.3]
- google-api-core [required: >=1.21.0,<3.0.0dev, installed: 1.31.3]
- google-api-core [required: >=1.26.0,<3.0.0dev, installed: 1.31.3]
- google-api-core [required: >=1.21.0,<2.0.0dev, installed: 1.31.3]
- google-api-core [required: >=1.29.0,<3.0dev, installed: 1.31.3]
- google-api-core [required: >=1.21.0,<2.0.0dev, installed: 1.31.3]
- google-api-core [required: >=1.14.0,<2.0.0dev, installed: 1.31.3]
- google-api-core [required: >=1.21.0,<2.0.0dev, installed: 1.31.3]
- google-api-core [required: >=1.26.0,<3.0.0dev, installed: 1.31.3]
My requirements.txt is shown below.
Is there a combination of versions of google-cloud-ndb, google-cloud-tasks, and firebase-admin that work together?
When version numbers are not explicitly set in requirements.txt, the system will install the most recent version. And sometimes, the most recent version of one package is not compatible to another package.
In your project, google-api-core 2.1.1 is automatically installed but your version of google-cloud-datastore needs something lower than 2.0.0 but a minimum of 1.14.0. The same logic goes with the warnings related to google-cloud-core 1.7.2.
To fix this, you should explicitly set the version numbers for the mentioned packages using the version range provided in the warning message. You'll have to pick something that works for you. For example, you can have google-api-core 1.14.0 in your requirements.txt file but this assumes that there is nothing in your code that needs a feature that is in a higher release.
Fixing the versions of google-api-core and google-auth gets rid of the version incompatibilities. It looks like there are a lot of changes with version 2 of these libraries (which are new as of a few months ago), and that firebase hasn't caught up yet so I fixed the most recent 1.* version.
Here is a working requirements.txt using latest libraries:
Werkzeug==1.0.1
Flask==1.1.2
Flask-Login==0.5.0
Flask-WTF==0.14.3
google-api-core==1.31.5 # Avoid conflicts
google-auth==1.35.0 # Avoid conflicts
google-cloud-ndb==1.11.1
google-cloud-tasks==2.7.1
firebase-admin==5.2.0
I wish pip could figure this stuff out...

What causes Python packages installed with pipenv to not be found when called in script?

On a Windows 10 machine with Python 3.9.5 and pipenv 2021.5.29. In a pipenv shell:
Creating a virtualenv for this project...
Pipfile: C:\Users\jp\Documents\programming\imseg\Pipfile
Using C:/OSGeo4W/bin/python.exe (3.9.5) to create virtualenv...
[ ===] Creating virtual environment...created virtual environment CPython3.9.5.final.0-64 in 612ms
creator CPython3Windows(dest=C:\Users\jp\.virtualenvs\imseg-cT2t34Fc, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\jp\AppData\Local\pypa\virtualenv)
added seed packages: pip==21.2.2, setuptools==57.4.0, wheel==0.36.2
activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator
Successfully created virtual environment!
Virtualenv location: C:\Users\jp\.virtualenvs\imseg-cT2t34Fc
Launching subshell in virtual environment...
Microsoft Windows [Version 10.0.19043.1165]
(c) Microsoft Corporation. All rights reserved.
I used pipenv install. This returns:
(imseg-cT2t34Fc) C:\Users\jp\Documents\programming\imseg>pipenv install
Installing dependencies from Pipfile.lock (684440)...
================================ 19/19 - 00:01:02
pipenv graph:
(imseg-cT2t34Fc) C:\Users\jp\Documents\programming\imseg>pipenv graph
Cython==0.29.24
GitPython==3.1.18
- gitdb [required: >=4.0.1,<5, installed: 4.0.7]
- smmap [required: >=3.0.1,<5, installed: 4.0.0]
matplotlib==3.4.2
- cycler [required: >=0.10, installed: 0.10.0]
- six [required: Any, installed: 1.16.0]
- kiwisolver [required: >=1.0.1, installed: 1.3.1]
- numpy [required: >=1.16, installed: 1.21.1]
- pillow [required: >=6.2.0, installed: 8.3.1]
- pyparsing [required: >=2.2.1, installed: 2.4.7]
- python-dateutil [required: >=2.7, installed: 2.8.2]
- six [required: >=1.5, installed: 1.16.0]
opencv-python==4.5.3.56
- numpy [required: >=1.19.3, installed: 1.21.1]
pandas==1.3.1
- numpy [required: >=1.17.3, installed: 1.21.1]
- python-dateutil [required: >=2.7.3, installed: 2.8.2]
- six [required: >=1.5, installed: 1.16.0]
- pytz [required: >=2017.3, installed: 2021.1]
rawpy==0.16.0
- numpy [required: Any, installed: 1.21.1]
torchvision==0.10.0
- numpy [required: Any, installed: 1.21.1]
- pillow [required: >=5.3.0, installed: 8.3.1]
- torch [required: ==1.9.0, installed: 1.9.0]
- typing-extensions [required: Any, installed: 3.10.0.0]
Yet, when I try to call the script for which the environment was created, I get:
(imseg-cT2t34Fc) C:\Users\jp\Documents\programming\imseg\src>python3 model.py
Traceback (most recent call last):
File "C:\Users\jp\Documents\programming\imseg\src\model.py", line 14, in <module>
import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
I read and tried
pip install pipx
pipx install pipenv
and there was no change in the problem. What is wrong with my pipenv environment?
EDIT:
where python3 returns:
C:\OSGeo4W\bin\python3.exe
C:\OSGeo4W\apps\Python39\python3.exe
C:\Users\jp\AppData\Local\Microsoft\WindowsApps\python3.exe
EDIT (#2):
It's unclear to me where the python executable is supposed to exist? I guess I don't get the virtual environment thing. If the python executable is supposed to exist in virtual env., why isn't the python executable installed inside the virtual env. to begin? The pipenv website just says to have python and I installed as pip3 install --user pipenv, so it seems like it should work. I'm still wondering how to fix this problem.
The answer is quite simple. The line that calls the Python executable should be
pipenv run python model.py
instead of
python model.py
as pointed out in the accepted answer to this question.

There are incompatible versions in the resolved dependencies

I’m trying to just run my python project that seems to work fine on my Mac (best in pycharm, not as good but can run in VSCode) and terrible on my raspberry pi in VSCode. Whenever I run a pipenv shell and then a pipenv install it just complains with this error:
Pipfile.lock (e9a11d) out of date, updating to (47943b)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✘ Locking Failed!
[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 741, in _main
[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 709, in resolve_packages
[ResolutionFailure]: requirements_dir=requirements_dir,
[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 692, in resolve
[ResolutionFailure]: req_dir=requirements_dir
[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1403, in resolve_deps
[ResolutionFailure]: req_dir=req_dir,
[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1108, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 833, in resolve
[ResolutionFailure]: raise ResolutionFailure(message=str(e))
[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: Could not find a version that matches graphene-django>=3.0.0b1 (from -r /tmp/pipenvcczdc6ayrequirements/pipenv-eg1jqra7-constraints.txt (line 3))
Tried: 1.0, 1.1.0, 1.2.0, 1.2.1, 1.3, 2.0.0, 2.0.0, 2.1.0, 2.1.0, 2.2.0, 2.2.0, 2.3.0, 2.3.0, 2.3.2, 2.3.2, 2.4.0, 2.4.0, 2.5.0, 2.5.0, 2.6.0, 2.6.0, 2.7.0, 2.7.0, 2.7.1, 2.7.1, 2.8.0, 2.8.0, 2.8.1, 2.8.1, 2.8.2, 2.8.2, 2.9.0, 2.9.0, 2.9.1, 2.9.1, 2.10.0, 2.10.0, 2.10.1, 2.10.1, 2.11.0, 2.11.0, 2.11.1, 2.11.1, 2.12.0, 2.12.0, 2.12.1, 2.12.1, 2.13.0, 2.13.0, 2.14.0, 2.14.0, 2.15.0, 2.15.0
Skipped pre-versions: 1.0.dev20160909000001, 1.0.dev20160910000001, 1.0.dev20160917000001, 1.0.dev20160919000001, 1.0.dev20160919000002, 1.0.dev20160919000003, 1.0.dev20160919000004, 1.0.dev20160920000001, 1.0.dev20160922000001, 2.0.dev2017072501, 2.0.dev2017072601, 2.0.dev2017073101, 2.0.dev2017073101, 2.0.dev2017083101, 2.0.dev2017083101, 2.1rc0, 2.1rc0, 2.1rc1, 2.1rc1, 3.0.0b1, 3.0.0b1, 3.0.0b2, 3.0.0b2, 3.0.0b3, 3.0.0b3, 3.0.0b4, 3.0.0b4, 3.0.0b5, 3.0.0b5, 3.0.0b6, 3.0.0b6, 3.0.0b7, 3.0.0b7
There are incompatible versions in the resolved dependencies:
graphene-django (from -r /tmp/pipenvcczdc6ayrequirements/pipenv-eg1jqra7-constraints.txt (line 3))
graphene-django>=3.0.0b1 (from django-graphql-jwt==0.3.2->-r /tmp/pipenvcczdc6ayrequirements/pipenv-eg1jqra7-constraints.txt (line 5))
I don’t see what’s incompatible after running a pipenv graph (after pipenv install --skip-lock) as it returns this:
django-cors-headers==3.7.0
- Django [required: >=2.2, installed: 3.2.3]
- asgiref [required: >=3.3.2,<4, installed: 3.3.4]
- typing-extensions [required: Any, installed: 3.10.0.0]
- pytz [required: Any, installed: 2021.1]
- sqlparse [required: >=0.2.2, installed: 0.4.1]
django-graphql-jwt==0.3.2
- Django [required: >=1.11, installed: 3.2.3]
- asgiref [required: >=3.3.2,<4, installed: 3.3.4]
- typing-extensions [required: Any, installed: 3.10.0.0]
- pytz [required: Any, installed: 2021.1]
- sqlparse [required: >=0.2.2, installed: 0.4.1]
- graphene-django [required: >=3.0.0b1, installed: 3.0.0b7]
- Django [required: >=2.2, installed: 3.2.3]
- asgiref [required: >=3.3.2,<4, installed: 3.3.4]
- typing-extensions [required: Any, installed: 3.10.0.0]
- pytz [required: Any, installed: 2021.1]
- sqlparse [required: >=0.2.2, installed: 0.4.1]
- graphene [required: >=3.0.0b5,<4, installed: 3.0b7]
- aniso8601 [required: >=8,<9, installed: 8.1.1]
- graphql-core [required: >=3.1.2,<4, installed: 3.1.5]
- graphql-relay [required: >=3.0,<4, installed: 3.1.0]
- graphql-core [required: >=3.1, installed: 3.1.5]
- typing-extensions [required: >=3.7,<4, installed: 3.10.0.0]
- graphql-core [required: >=3.1.0,<4, installed: 3.1.5]
- promise [required: >=2.1, installed: 2.3]
- six [required: Any, installed: 1.16.0]
- text-unidecode [required: Any, installed: 1.3]
- PyJWT [required: >=2,<3, installed: 2.1.0]
Rx==1.6.1
singledispatch==3.6.1
- six [required: Any, installed: 1.16.0]
It seems that every version is installed correctly version-wide, including the graphene-django that it complains about [required: >=3.0.0b1, installed: 3.0.0b7].
Why is this error happening?
pip3 list returns:
Package Version
------------------- --------
aniso8601 8.1.1
asgiref 3.3.4
Django 3.2.3
django-cors-headers 3.7.0
django-graphql-jwt 0.3.2
graphene 3.0b7
graphene-django 3.0.0b7
graphql-core 3.1.5
graphql-relay 3.1.0
pip 21.1.1
promise 2.3
PyJWT 2.1.0
pytz 2021.1
Rx 1.6.1
setuptools 56.0.0
singledispatch 3.6.1
six 1.16.0
sqlparse 0.4.1
text-unidecode 1.3
typing-extensions 3.10.0.0
wheel 0.36.2
The Pipfile:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
django = "*"
django-graphql-jwt = "*"
pyjwt = "1.7.1"
django-cors-headers = "*"
graphene-django = "*"
[requires]
python_version = "3.7"
[dev-packages]
I’ve tried a ton of things to try to fix this any have no idea where to go from here. I wanted to deploy this python, graphql and react project on my raspberry pi, but I assume I can’t if I can’t even get it to run. I'm trying to run this on my raspberry pi (running raspbian), and it is the back-end python app where the issue lies.
Any help, anything would be very much appreciated. I’m a beginner with python.
You somehow managed to install beta versions (used the --pre flag before then deleted the option from Pipfile, for example or used pip directly in the virtual env).
Now, because django-graphql-jwt doesn't conform to semantic versioning, they decided to depend on a major version, pre-release in a patch release ¯\_(ツ)_/¯
.
Since the 0.3.1 version of django-graphql-jtw depends on >=2.5.1, your beta version will still match, but without the --pre flag locking will fail, because the highest non-beta version is 2.5.1. That is the conflict being shown (but the output isn't very clear).
The resolution that should solve the issue is:
pipenv uninstall django-graphql-jwt django-graphene graphene graphql
# followed by:
pipenv install 'django-graphql-jwt<0.3.2'
The problem seems to be that graphene-django only has version 2.15.0 according to PyPI https://pypi.org/project/graphene-django/. But for some reason in this commit of the library django-graphql-jwt it asks for
a version 3.0.0b1. Which I think is the issue that shows in your log:
ERROR: Could not find a version that matches graphene-django>=3.0.0b1 (from -r /tmp/pipenvcczdc6ayrequirements/pipenv-eg1jqra7-constraints.txt (line 3))
Apparently in this commit the latest graphene-django version was still supported. So my guess is that maybe downgrading to:
django-graphql-jwt="0.3.1"
instead of 0.3.2 should solve the problem. And it this case you can report them the issue.
Actually Pipenv doesn't have a smart enough dependency resolver. I ran into the similar issue and switched to poetry. Poetry will resolve your dependencies to the latest versions that match the constraints and don't conflict with each other.
Poetry is also much faster than Pipenv and provides a better user experience.
# pyproject.toml
[build-system]
requires = ["poetry>=1.12"]
build-backend = "poetry.masonry.api"
[tool.poetry]
name = "sample"
version = "0.1.0"
description = "Sample"
authors = []
[tool.poetry.dependencies]
python = "~3.7"
django = "*"
django-graphql-jwt = "*"
pyjwt = "1.7.1"
django-cors-headers = "*"
graphene-django = "*"
In shell:
$ poetry --version
Poetry version 1.1.6
$ poetry lock
Updating dependencies
Resolving dependencies... (15.3s)
Writing lock file
$ poetry install
Installing dependencies from lock file
Package operations: 17 installs, 0 updates, 0 removals
• Installing six (1.16.0)
• Installing promise (2.3)
• Installing rx (1.6.1)
• Installing graphql-core (2.3.2)
• Installing typing-extensions (3.10.0.0)
• Installing aniso8601 (7.0.0)
• Installing asgiref (3.3.4)
• Installing graphql-relay (2.0.1)
• Installing pytz (2021.1)
• Installing django (3.2.3)
• Installing graphene (2.1.8)
• Installing singledispatch (3.6.2)
• Installing text-unidecode (1.3)
• Installing graphene-django (2.15.0)
• Installing pyjwt (1.7.1)
• Installing django-cors-headers (3.7.0)
• Installing django-graphql-jwt (0.3.1)

Categories