I'm trying to install the dependencies for a project that's working on a colleague's machine.
The Pipfile looks like:
Pipfile
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
aio-pika = "==7.2.0"
aiohttp = "==3.8.1"
aiormq = "==6.2.3"
aiosignal = "==1.2.0"
async-timeout = "==4.0.2"
attrs = "==21.4.0"
beautifulsoup4 = "==4.11.1"
bokeh = "==2.4.2"
bs4 = "==0.0.1"
charset-normalizer = "==2.0.12"
click = "==8.1.3"
cycler = "==0.11.0"
et-xmlfile = "==1.1.0"
fonttools = "==4.33.3"
frozenlist = "==1.3.0"
idna = "==3.3"
jinja2 = "==3.1.2"
joblib = "==1.1.0"
kiwisolver = "==1.4.2"
markupsafe = "==2.1.1"
matplotlib = "==3.5.2"
motor = "==3.0.0"
multidict = "==6.0.2"
nltk = "==3.7"
numpy = "==1.22.3"
openpyxl = "==3.0.10"
pamqp = "==3.1.0"
pandas = "==1.4.2"
pillow = "==9.1.0"
pymongo = "==4.3.3"
pyparsing = "==3.0.8"
python-dateutil = "==2.8.2"
pytz = "==2022.1"
pyyaml = "==6.0"
regex = "==2022.4.24"
scikit-learn = "==1.0.2"
scipy = "==1.8.0"
seaborn = "==0.11.2"
six = "==1.16.0"
sklearn = "==0.0"
soupsieve = "==2.3.2.post1"
threadpoolctl = "==3.1.0"
tornado = "==6.1"
tqdm = "==4.64.0"
typing-extensions = "==4.2.0"
xlsxwriter = "==3.0.3"
yarl = "==1.7.2"
jwt = "*"
argon2-cffi = "*"
requests = "*"
[dev-packages]
[requires]
python_version = "*"
I try to install the dependencies with
pipenv install
On doing so, I get the following error:
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
You can use $ pipenv run pip install <requirement_name> to bypass this mechanism, then run $ pipenv graph to inspect the versions actually installed in the virtualenv.
Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: metadata generation failed
The stacktrace doesn't seem to indicate which package failed, and only points to lines from files within pipenv. I can include the entire stacktrace if necessary.
I'm not sure which dependency to try, so I can' do pipenv run pip install <requirement_name>
, so instead I run pipenv graph
. Nothing results. So, I try to manually install every package with pipenv run pip install <all packages>
. That seems to do something. I again run pipenv graph
aio-pika==9.2.1
├── aiormq [required: >=6.7.7,<6.8.0, installed: 6.7.7]
│ ├── pamqp [required: ==3.2.1, installed: 3.2.1]
│ └── yarl [required: Any, installed: 1.9.2]
│ ├── idna [required: >=2.0, installed: 3.4]
│ └── multidict [required: >=4.0, installed: 6.0.4]
└── yarl [required: Any, installed: 1.9.2]
├── idna [required: >=2.0, installed: 3.4]
└── multidict [required: >=4.0, installed: 6.0.4]
aiohttp==3.8.5
├── aiosignal [required: >=1.1.2, installed: 1.3.1]
│ └── frozenlist [required: >=1.1.0, installed: 1.4.0]
├── async-timeout [required: >=4.0.0a3,<5.0, installed: 4.0.3]
├── attrs [required: >=17.3.0, installed: 23.1.0]
├── charset-normalizer [required: >=2.0,<4.0, installed: 3.2.0]
├── frozenlist [required: >=1.1.1, installed: 1.4.0]
├── multidict [required: >=4.5,<7.0, installed: 6.0.4]
└── yarl [required: >=1.0,<2.0, installed: 1.9.2]
├── idna [required: >=2.0, installed: 3.4]
└── multidict [required: >=4.0, installed: 6.0.4]
argon2-cffi==21.3.0
└── argon2-cffi-bindings [required: Any, installed: 21.2.0]
└── cffi [required: >=1.0.1, installed: 1.15.1]
└── pycparser [required: Any, installed: 2.21]
bokeh==3.2.1
├── contourpy [required: >=1, installed: 1.1.0]
│ └── numpy [required: >=1.16, installed: 1.25.2]
├── Jinja2 [required: >=2.9, installed: 3.1.2]
│ └── MarkupSafe [required: >=2.0, installed: 2.1.3]
├── numpy [required: >=1.16, installed: 1.25.2]
├── packaging [required: >=16.8, installed: 23.1]
├── pandas [required: >=1.2, installed: 2.0.3]
│ ├── numpy [required: >=1.21.0, installed: 1.25.2]
│ ├── numpy [required: >=1.23.2, installed: 1.25.2]
│ ├── python-dateutil [required: >=2.8.2, installed: 2.8.2]
│ │ └── six [required: >=1.5, installed: 1.16.0]
│ ├── pytz [required: >=2020.1, installed: 2023.3]
│ └── tzdata [required: >=2022.1, installed: 2023.3]
├── pillow [required: >=7.1.0, installed: 10.0.0]
├── PyYAML [required: >=3.10, installed: 6.0.1]
├── tornado [required: >=5.1, installed: 6.3.2]
└── xyzservices [required: >=2021.09.1, installed: 2023.7.0]
bs4==0.0.1
└── beautifulsoup4 [required: Any, installed: 4.12.2]
└── soupsieve [required: >1.2, installed: 2.4.1]
jwt==1.3.1
└── cryptography [required: >=3.1,!=3.4.0, installed: 41.0.3]
└── cffi [required: >=1.12, installed: 1.15.1]
└── pycparser [required: Any, installed: 2.21]
motor==3.2.0
└── pymongo [required: >=4.4,<5, installed: 4.4.1]
└── dnspython [required: >=1.16.0,<3.0.0, installed: 2.4.2]
nltk==3.8.1
├── click [required: Any, installed: 8.1.6]
├── joblib [required: Any, installed: 1.3.2]
├── regex [required: >=2021.8.3, installed: 2023.8.8]
└── tqdm [required: Any, installed: 4.66.1]
openpyxl==3.1.2
└── et-xmlfile [required: Any, installed: 1.1.0]
requests==2.31.0
├── certifi [required: >=2017.4.17, installed: 2023.7.22]
├── charset-normalizer [required: >=2,<4, installed: 3.2.0]
├── idna [required: >=2.5,<4, installed: 3.4]
└── urllib3 [required: >=1.21.1,<3, installed: 2.0.4]
scikit-learn==1.3.0
├── joblib [required: >=1.1.1, installed: 1.3.2]
├── numpy [required: >=1.17.3, installed: 1.25.2]
├── scipy [required: >=1.5.0, installed: 1.11.1]
│ └── numpy [required: >=1.21.6,<1.28.0, installed: 1.25.2]
└── threadpoolctl [required: >=2.0.0, installed: 3.2.0]
seaborn==0.12.2
├── matplotlib [required: >=3.1,!=3.6.1, installed: 3.7.2]
│ ├── contourpy [required: >=1.0.1, installed: 1.1.0]
│ │ └── numpy [required: >=1.16, installed: 1.25.2]
│ ├── cycler [required: >=0.10, installed: 0.11.0]
│ ├── fonttools [required: >=4.22.0, installed: 4.42.0]
│ ├── kiwisolver [required: >=1.0.1, installed: 1.4.4]
│ ├── numpy [required: >=1.20, installed: 1.25.2]
│ ├── packaging [required: >=20.0, installed: 23.1]
│ ├── pillow [required: >=6.2.0, installed: 10.0.0]
│ ├── pyparsing [required: >=2.3.1,<3.1, installed: 3.0.9]
│ └── python-dateutil [required: >=2.7, installed: 2.8.2]
│ └── six [required: >=1.5, installed: 1.16.0]
├── numpy [required: >=1.17,!=1.24.0, installed: 1.25.2]
└── pandas [required: >=0.25, installed: 2.0.3]
├── numpy [required: >=1.21.0, installed: 1.25.2]
├── numpy [required: >=1.23.2, installed: 1.25.2]
├── python-dateutil [required: >=2.8.2, installed: 2.8.2]
│ └── six [required: >=1.5, installed: 1.16.0]
├── pytz [required: >=2020.1, installed: 2023.3]
└── tzdata [required: >=2022.1, installed: 2023.3]
sklearn==0.0.post7
typing-extensions==4.7.1
XlsxWriter==3.1.2
I search online for automatic dependency issue checkers for a pipenv graph output, but can't find one, so manually search eat package subdependency for any conflicts. By my eye, there aren't any. Not being entirely clear on what to do next, I try pipenv lock
, because I believe that should generate a pipenv lockfile based on the actual packages installed in the VM.
I get the same error as before.
I ask my colleague to run pipenv graph
and send me the output. He does:
aio-pika==7.2.0
- aiormq [required: ~=6.2.3, installed: 6.2.3]
- pamqp [required: ==3.1.0, installed: 3.1.0]
- yarl [required: Any, installed: 1.7.2]
- idna [required: >=2.0, installed: 3.3]
- multidict [required: >=4.0, installed: 6.0.2]
- yarl [required: Any, installed: 1.7.2]
- idna [required: >=2.0, installed: 3.3]
- multidict [required: >=4.0, installed: 6.0.2]
aiohttp==3.8.1
- aiosignal [required: >=1.1.2, installed: 1.2.0]
- frozenlist [required: >=1.1.0, installed: 1.3.0]
- async-timeout [required: >=4.0.0a3,<5.0, installed: 4.0.2]
- attrs [required: >=17.3.0, installed: 21.4.0]
- charset-normalizer [required: >=2.0,<3.0, installed: 2.0.12]
- frozenlist [required: >=1.1.1, installed: 1.3.0]
- multidict [required: >=4.5,<7.0, installed: 6.0.2]
- yarl [required: >=1.0,<2.0, installed: 1.7.2]
- idna [required: >=2.0, installed: 3.3]
- multidict [required: >=4.0, installed: 6.0.2]
argon2-cffi==21.3.0
- argon2-cffi-bindings [required: Any, installed: 21.2.0]
- cffi [required: >=1.0.1, installed: 1.15.1]
- pycparser [required: Any, installed: 2.21]
bokeh==2.4.2
- Jinja2 [required: >=2.9, installed: 3.1.2]
- MarkupSafe [required: >=2.0, installed: 2.1.1]
- numpy [required: >=1.11.3, installed: 1.22.3]
- packaging [required: >=16.8, installed: 23.0]
- pillow [required: >=7.1.0, installed: 9.1.0]
- PyYAML [required: >=3.10, installed: 6.0]
- tornado [required: >=5.1, installed: 6.1]
- typing-extensions [required: >=3.10.0, installed: 4.2.0]
bs4==0.0.1
- beautifulsoup4 [required: Any, installed: 4.11.1]
- soupsieve [required: >1.2, installed: 2.3.2.post1]
jwt==1.3.1
- cryptography [required: !=3.4.0,>=3.1, installed: 40.0.1]
- cffi [required: >=1.12, installed: 1.15.1]
- pycparser [required: Any, installed: 2.21]
motor==3.0.0
- pymongo [required: >=4.1,<5, installed: 4.3.3]
- dnspython [required: <3.0.0,>=1.16.0, installed: 2.3.0]
nltk==3.7
- click [required: Any, installed: 8.1.3]
- joblib [required: Any, installed: 1.1.0]
- regex [required: >=2021.8.3, installed: 2022.4.24]
- tqdm [required: Any, installed: 4.64.0]
openpyxl==3.0.10
- et-xmlfile [required: Any, installed: 1.1.0]
pkg-resources==0.0.0
requests==2.28.2
- certifi [required: >=2017.4.17, installed: 2022.12.7]
- charset-normalizer [required: >=2,<4, installed: 2.0.12]
- idna [required: <4,>=2.5, installed: 3.3]
- urllib3 [required: <1.27,>=1.21.1, installed: 1.26.15]
seaborn==0.11.2
- matplotlib [required: >=2.2, installed: 3.5.2]
- cycler [required: >=0.10, installed: 0.11.0]
- fonttools [required: >=4.22.0, installed: 4.33.3]
- kiwisolver [required: >=1.0.1, installed: 1.4.2]
- numpy [required: >=1.17, installed: 1.22.3]
- packaging [required: >=20.0, installed: 23.0]
- pillow [required: >=6.2.0, installed: 9.1.0]
- pyparsing [required: >=2.2.1, installed: 3.0.8]
- python-dateutil [required: >=2.7, installed: 2.8.2]
- six [required: >=1.5, installed: 1.16.0]
- numpy [required: >=1.15, installed: 1.22.3]
- pandas [required: >=0.23, installed: 1.4.2]
- numpy [required: >=1.18.5, installed: 1.22.3]
- python-dateutil [required: >=2.8.1, installed: 2.8.2]
- six [required: >=1.5, installed: 1.16.0]
- pytz [required: >=2020.1, installed: 2022.1]
- scipy [required: >=1.0, installed: 1.8.0]
- numpy [required: <1.25.0,>=1.17.3, installed: 1.22.3]
sklearn==0.0
- scikit-learn [required: Any, installed: 1.0.2]
- joblib [required: >=0.11, installed: 1.1.0]
- numpy [required: >=1.14.6, installed: 1.22.3]
- scipy [required: >=1.1.0, installed: 1.8.0]
- numpy [required: <1.25.0,>=1.17.3, installed: 1.22.3]
- threadpoolctl [required: >=2.0.0, installed: 3.1.0]
XlsxWriter==3.0.3
I manually update the Pipfile to match the package versions he sent (changing jwt, argon2-cffi, and requests to hardcoded version numbers). I believe I clear the vm by doing pipenv --rm
, then do pipenv install
. I get the same error again.
How can I resolve a pipenv dependency issue when apparently no packages have dependency issues? Alternatively, are there dependency issues I'm just not seeing somehow?
python --version
Python 3.11.3
pipenv --version
pipenv, version 2023.7.23
The issue was that my coworker and I were using different python versions. This was further confused by the fact that he wasn't using the python version defined in the .python-version
file, and that apparently pipenv doesn't use the .python-version
file but instead the python_version
property of the [requires]
block of the Pipfile
. The solution was to change the following part of the Pipfile:
[requires]
python_version = "*"
To explicitly define the python version he said he was using locally:
[requires]
python_version = "3.8.10"
Then, I had to clear my pyenv virtual environment with pipenv --rm
, then reinitialize and install packages with pipenv install
. Upon doing so, pipenv detected the python version and installed it. This operation finally completed successfully, and when I entered the virtual environment with pipenv shell
, I could confirm I was using python version 3.8.10 with python --version
. Furthermore, the application ran correctly within the virtual environment.