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
Related
I have an AWS EMR cluster and all the steps are failing with the error:
'''
ModuleNotFoundError: No module named 'boto3'
'''
Python and pip versions:
'''
python --version
Python 3.7.10
pip --version
pip 20.2.2 from /usr/lib/python3.7/site-packages/pip (python 3.7)
'''
Here's my requirements.txt file:
'''
aiobotocore==1.2.1
aiohttp==3.7.3
aioitertools==0.7.1
astroid==2.5
async-timeout==3.0.1
attrs==20.3.0
avro-python3
avro-validator==1.0.9
aws-encryption-sdk==2.0.0
aws-encryption-sdk-cli==2.1.0
aws-logging-handlers==2.0.5
base64io==1.0.3
boto3==1.16.34
botocore==1.19.63
certifi==2020.12.5
cffi==1.14.5
chardet==3.0.4
configparser==5.0.1
cryptography==3.3.1
cycler==0.10.0
datacompy==0.7.1
DateTime==4.3
deap==1.3.1
decorator==4.4.2
elasticsearch==7.10.1
fsspec==0.8.5
idna==3.1
importlib-metadata==3.4.0
iniconfig==1.1.1
isort==5.7.0
jmespath==0.10.0
joblib==1.0.1
kiwisolver==1.2.0
lazy-object-proxy==1.5.2
matplotlib==3.3.3
mccabe==0.6.1
multidict==5.1.0
networkx==2.5
numpy==1.19.4
packaging==20.9
pandas==1.1.5
patsy==0.5.1
Pillow==8.1.0
pluggy==0.13.1
psycopg2==2.8.6
psycopg2-binary==2.8.6
py==1.10.0
pyarrow==0.17.1
pycparser==2.20
pylint==2.6.0
pyparsing==2.4.7
pytest==6.2.2
python-dateutil==2.8.1
pytz==2021.1
regex==2020.7.14
s3-concat==0.2.1
s3fs==0.5.1
s3transfer==0.3.4
scikit-learn==0.23.2
scikit-posthocs==0.6.6
scipy==1.5.4
seaborn==0.11.0
six==1.15.0
sklearn-deap2==0.2.2
sparkmeasure==0.14.0
statsmodels==0.9.0
threadpoolctl==2.1.0
toml==0.10.2
typed-ast==1.4.2
typing-extensions==3.7.4.3
urllib3==1.26.3
wrapt==1.12.1
xlrd==1.2.0
xmltodict==0.12.0
yarl==1.6.3
zipp==3.4.0
zope.interface==5.2.0
tsfresh==0.18.0
apache-sedona==1.0.1
py4j==0.10.9
shapely==1.7.1
pyspark==3.0.3
numba==0.53.1
'''
This is the command to install the packages:
'''
sudo pip-3.7 --default-timeout=60 install -r /tmp/requirements.txt
'''
Below is the output from "pip list"
'''
Package Version
-------------------------- ---------
aiobotocore 1.2.1
aiohttp 3.7.3
aioitertools 0.7.1
apache-sedona 1.0.1
astroid 2.5
async-timeout 3.0.1
attrs 20.3.0
avro-python3 1.10.2
avro-validator 1.0.9
aws-cfn-bootstrap 2.0
aws-encryption-sdk 2.0.0
aws-encryption-sdk-cli 2.1.0
aws-logging-handlers 2.0.5
base64io 1.0.3
beautifulsoup4 4.9.3
boto 2.49.0
boto3 1.24.20
botocore 1.19.52
certifi 2020.12.5
cffi 1.14.5
chardet 3.0.4
charset-normalizer 2.1.0
click 8.0.3
cloudpickle 2.1.0
configparser 5.0.1
cryptography 3.3.1
cycler 0.10.0
dask 2022.2.0
datacompy 0.7.1
DateTime 4.3
deap 1.3.1
decorator 4.4.2
distributed 2022.2.0
docutils 0.14
elasticsearch 7.10.1
fonttools 4.33.3
fsspec 0.8.5
HeapDict 1.0.1
idna 3.1
importlib-metadata 3.4.0
iniconfig 1.1.1
isort 5.7.0
Jinja2 3.1.2
jmespath 0.10.0
joblib 1.0.1
kiwisolver 1.2.0
lazy-object-proxy 1.5.2
llvmlite 0.38.1
locket 1.0.0
lockfile 0.11.0
lxml 4.6.3
MarkupSafe 2.1.1
matplotlib 3.5.2
matrixprofile 1.1.10
mccabe 0.6.1
msgpack 1.0.4
multidict 5.1.0
mysqlclient 1.4.2
networkx 2.5
nltk 3.6.5
nose 1.3.4
numba 0.53.1
numpy 1.19.4
packaging 20.9
pandas 1.1.5
partd 1.2.0
patsy 0.5.1
Pillow 8.1.0
pip 20.2.2
pluggy 0.13.1
protobuf 3.11.2
psutil 5.9.1
psycopg2 2.8.6
psycopg2-binary 2.8.6
py 1.10.0
py-dateutil 2.2
py4j 0.10.9
pycparser 2.20
pylint 2.6.0
pyparsing 2.4.7
pyspark 3.0.3
pystache 0.5.4
pytest 6.2.2
python-daemon 2.2.3
python-dateutil 2.8.1
python37-sagemaker-pyspark 1.4.1
pytz 2021.1
PyYAML 5.4.1
regex 2020.7.14
requests 2.28.1
s3-concat 0.2.1
s3fs 0.5.1
s3transfer 0.3.4
scikit-learn 0.23.2
scikit-posthocs 0.6.6
scipy 1.5.4
seaborn 0.11.0
setuptools 49.1.3
Shapely 1.8.2
simplejson 3.2.0
six 1.15.0
sklearn-deap2 0.2.2
sortedcontainers 2.4.0
sparkmeasure 0.14.0
statsmodels 0.9.0
stumpy 1.11.1
tblib 1.7.0
threadpoolctl 2.1.0
toml 0.10.2
toolz 0.11.2
tornado 6.1
tqdm 4.62.3
tsfresh 0.18.0
typed-ast 1.4.2
typing-extensions 3.7.4.3
urllib3 1.26.3
windmill 1.6
wrapt 1.12.1
xlrd 1.2.0
xmltodict 0.12.0
yarl 1.6.3
zict 2.2.0
zipp 3.4.0
zope.interface 5.2.0
'''
From the above pip list output, boto3 is installed. Still the steps are failing.
Please help!
if u are using linux try:
$ pip3 install boto3
make sure to rerun without sudo
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...
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.
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)
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.