Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies. #209

Closed
giuscri opened this issue May 15, 2018 · 9 comments

Comments

@giuscri
Copy link

giuscri commented May 15, 2018

$ pipenv install black
Installing black…
Collecting black
  Downloading https://files.pythonhosted.org/packages/db/c8/c587383e6b57a07b9937ac29ff93f845aa3d344aa9242f0eba13163eaa2b/black-18.4a4-py36-none-any.whl (67kB)
Requirement already satisfied: attrs>=17.4.0 in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (from black) (18.1.0)
Collecting click (from black)
  Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
Collecting appdirs (from black)
  Downloading https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl
Installing collected packages: click, appdirs, black
Successfully installed appdirs-1.4.3 black-18.4a4 click-6.7

Adding black to Pipfile's [packages]…
Pipfile.lock (7076dc) out of date, updating to (f7eff5)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…

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.
Could not find a version that matches black
Tried: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4
There are incompatible versions in the resolved dependencies.

@giuscri
Copy link
Author

giuscri commented May 15, 2018

See pypa/pipenv#875 (comment)

$ pipenv lock --pre --clear                                                                                                                  
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (f7eff5)!
$ pipenv install black
Installing black…
Requirement already satisfied: black in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (18.4a4)
Requirement already satisfied: attrs>=17.4.0 in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (from black) (18.1.0)
Requirement already satisfied: appdirs in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (from black) (1.4.3)
Requirement already satisfied: click in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (from black) (6.7)

Adding black to Pipfile's [packages]…
Installing dependencies from Pipfile.lock (f7eff5)…
     ================================ 47/47 — 00:00:18

@giuscri giuscri closed this as completed May 15, 2018
@ashishmohite
Copy link

See pypa/pipenv#875 (comment)

$ pipenv lock --pre --clear                                                                                                                  
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (f7eff5)!
$ pipenv install black
Installing black…
Requirement already satisfied: black in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (18.4a4)
Requirement already satisfied: attrs>=17.4.0 in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (from black) (18.1.0)
Requirement already satisfied: appdirs in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (from black) (1.4.3)
Requirement already satisfied: click in /home/g/.local/share/virtualenvs/thesis-W6OBZlR6/lib/python3.6/site-packages (from black) (6.7)

Adding black to Pipfile's [packages]…
Installing dependencies from Pipfile.lock (f7eff5)…
     ================================ 47/47 — 00:00:18

everytime I try to install any new package it fails same as above and then after that i've to run pipenv lock --pre --clear to fix it. Is there a permanent solution to this ?

@winterjung
Copy link

winterjung commented Mar 4, 2019

@ashishmohite I recommend to give specific black version when you install black, other dependency or lock from Pipfile.

$ pipenv install black==18.9b0
Installing black==18.9b0…
Adding black to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✔ Success!
Updated Pipfile.lock (ae2883)!
Installing dependencies from Pipfile.lock (ae2883)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 5/5 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

$ pipenv lock
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✔ Success!
Updated Pipfile.lock (ae2883)!

If you run pipenv lock --pre, other dependencies are also updated to the pre-release version like aiohttp==4.0.0.a0.(stable version: aiohttp==3.5.4).

@phihag
Copy link

phihag commented Aug 7, 2019

Kind of ironic that the tool that wants to set an opinionated standard for code format does not follow the opinionated standard for version numbers.

@hugovk
Copy link
Contributor

hugovk commented Aug 7, 2019

It follows another opinionated standard for version numbers.

@phihag
Copy link

phihag commented Aug 7, 2019

@hugovk Calver would not be a problem for pipenv; 19.3.0 or 19.3.1.0 (with b=1) would work just fine.

Adding letters into the version number (as in 19.3b0) causes the problem, because those are traditionally used for alphas, betas, pre-releases, and other specialized versions, which the average user does not want, and are therefore not picked by pipenv by default, rightfully so.

I'm not sure what the rationale behind using letters instead of digits is. In any case, it causes precisely what black wants to avoid: Because somebody made a possibly justified, but very unusual decision, everybody has to understand & deal with that special snowflake project.

@hugovk
Copy link
Contributor

hugovk commented Aug 8, 2019

Black is still in beta, the b0 is a text tag modifier.

A stable release is due out soon.

Maybe report it to pipenv? A pipenv workaround is black = "==18.9b0".

@Iain-S
Copy link

Iain-S commented Aug 13, 2020

I'll chime in to say that this also breaks conda env export:

conda create --prefix=black-env --no-default-packages
conda activate black-env/
conda install black
pip install nb-black
conda env export
InvalidVersionSpec: Invalid version '(>=': unable to convert to expression tree: ['(']

@smac89
Copy link

smac89 commented May 28, 2021

So the problem is now clear to me. Looks like the pipenv does not install what it considers to be "Pre-releases" versions of a package, and for some reason the package black, is always using pre-release version schemes. By supplying the --pre option to pipenv, we tell it to allow the dependency to be installed.

Another option is to manually specify one of the pre-release versions in your Pipfile and you should be able to simply do pipenv install

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

No branches or pull requests

7 participants