Ich verwende pipenv
, um die Abhängigkeiten eines Python-Pakets zu behandeln.
Das Python-Paket verwendet zwei Pakete (mit dem Namen pckg1
und pckg2
), die auf demselben Paket mit dem Namen pckg3
, basieren, jedoch aus zwei verschiedenen Versionen. Zeigt den Baum der Abhängigkeiten an:
$ pipenv graph
pckg1==3.0.0
- pckg3 [required: >=4.1.0]
pckg2==1.0.2
- pckg3 [required: ==4.0.11]
Ein Versuch, Abhängigkeiten zu installieren:
$ pipenv install
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 pckg3==4.0.11,==4.1.0,>=4.1.0 (from -r C:\Users\user\AppData\Local\Temp\pipenv-o7uxm080-requirements\pipenv-hwekv7dc-constraints.txt (line 2))
Tried: 3.3.1, 3.3.2, 3.3.3, 3.4.0, 3.4.2, 4.0.0, 4.0.0, 4.0.1, 4.0.1, 4.0.2, 4.0.2, 4.0.3, 4.0.3, 4.0.4, 4.0.4, 4.0.6, 4.0.6, 4.0.8, 4.0.8, 4.0.9, 4.0.9, 4.0.10, 4.0.10, 4.0.11, 4.0.11, 4.1.0, 4.1.0, 4.1.1, 4.1.1, 4.1.2, 4.1.2, 4.2.1, 4.2.1, 4.3.0, 4.3.0
There are incompatible versions in the resolved dependencies.
Wie vorgeschlagen, führt pip install --skip-lock
den Trick aus, aber der Abhängigkeitsbaum ist noch nicht gelöst.
Ich würde gerne Pipenv
sagen, um die Anforderung von pckg2
zu überschreiben und pckg3>=4.1.0
anzugeben.
Wie kann es gelöst werden?
Ich bekomme die ganze Zeit diesen Fehler. Das Reinigen des Cache in der Sperrdatei funktioniert jedes Mal einwandfrei.
$ pipenv lock --pre --clear
Wenn Sie eine Fehlermeldung erhalten wie:
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✘ Locking Failed!
Für mich geschah dies, weil sich die zugrunde liegende virtuelle Umgebung nicht auf mein aktuelles Verzeichnis bezog.
Ich habe dieses Problem gelöst, indem ich den Inhalt in ein neues Verzeichnis verschoben und das alte gelöscht habe.
Ich musste auch Pipfile
und Pipfile.lock
Löschen, bin mir aber nicht sicher, ob das notwendig ist.
Du kannst nicht Im Moment bietet pipenv
nichts zum expliziten Überschreiben von Anforderungseinschränkungen.
Um dieses Problem zu umgehen, können Sie Abhängigkeiten, die Sie überschreiben möchten, in dev-packages
einfügen, da diese durch packages
überschrieben werden. Diese Pipfile
sollte pckg3>=4.1.0
installieren:
# Pipfile
...
[packages]
pckg1 = "==3.0.0"
[dev-packages]
pckg2 = "==1.0.2"
Wenn Sie jetzt sperren und installieren:
$ pipenv lock --dev
$ pipenv install --dev
die Anforderung ==4.0.11
wird durch >=4.1.0
überschrieben. Das ist hässlich, wenn Sie mich fragen, denn dies ist nicht das, wofür Entwicklungspakete bestimmt sind, und Sie ändern die Rolle der pckg2
-Abhängigkeit in einem Projekt. Ich sehe jedoch keinen besseren Weg.
Ich habe ein ähnliches Problem mit google-cloud-core
.
$ pipenv lock
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
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.
Could not find a version that matches google-cloud-core<0.29dev,<0.30dev,>=0.28.0,>=0.29.0
Tried: 0.20.0, 0.20.0, 0.21.0, 0.21.0, 0.22.0, 0.22.0, 0.22.1, 0.22.1, 0.23.0, 0.23.0, 0.23.1, 0.23.1, 0.24.0, 0.24.0, 0.24.1, 0.24.1, 0.25.0, 0.25.0, 0.26.0, 0.26.0, 0.27.0, 0.27.0, 0.27.1, 0.27.1, 0.28.0, 0.28.0, 0.28.1, 0.28.1, 0.29.0, 0.29.0
There are incompatible versions in the resolved dependencies.
Es wurde von gelöst
Ich hatte ein ähnliches Problem mit Glob-Modul. Ich habe glob = "*"
aus Pipfile gelöscht und es hat gut funktioniert.
Error:
bash-4.2# pipenv lock --clear
Locking [dev-packages] dependencies…
✔ Success!
Locking [packages] dependencies…
✘ Locking Failed!
[pipenv.exceptions.ResolutionFailure]: File "/root/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv/resolver.py", line 69, in resolve
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "/root/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "/root/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "/root/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches glob
[pipenv.exceptions.ResolutionFailure]: No versions found
[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: ERROR: Could not find a version that matches glob
No versions found
Was https://pypi.org/simple reachable?
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "/root/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "/root/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "/root/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]: raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches glob
[pipenv.exceptions.ResolutionFailure]: No versions found
[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: ERROR: Could not find a version that matches glob
No versions found
Was https://pypi.org/simple reachable?
vi Pipfile und entferne die fehlerhaften Pakete. Hat gut für mich funktioniert.
Mir ist es genauso ergangen, ich arbeite mit Visual Studio Code und ich konnte es loswerden:
und dann versuchen, die fehlenden Abhängigkeiten für den virtuellen Ordner zu installieren und los geht's, es hat bei mir funktioniert.
pipenv lock
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
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.
pipenv install --clean