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

Created on 15 May 2018  ·  8Comments  ·  Source: psf/black

$ 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.

Most helpful comment

See https://github.com/pypa/pipenv/issues/875#issuecomment-377221492

$ 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

All 8 comments

See https://github.com/pypa/pipenv/issues/875#issuecomment-377221492

$ 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

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 ?

@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).

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 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.

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".

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: ['(']
Was this page helpful?
0 / 5 - 0 ratings