What should I do when pipenv lock command is not working? - python

I'm trying to do a command pipenv lock 'cause heroku said my Pipfile.lock is out of date, and I'm trying to upload my django project at heroku. But I constantly got the error like below.
PS C:\Users\josep\Documents\nomad academy\Airbnb-Clone> pipenv lock --pre --clear
Locking [dev-packages] dependencies...
Locking...Building requirements...
Resolving dependencies...
Locking Failed!
[ResolutionFailure]: File "c:\users\josep\.virtualenvs\airbnb-clone-grekw6gp\lib\site-packages\pipenv\resolver.py", line 741, in _main
[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]: File "c:\users\josep\.virtualenvs\airbnb-clone-grekw6gp\lib\site-packages\pipenv\resolver.py", line 702, in resolve_packages
[ResolutionFailure]: results, resolver = resolve(
[ResolutionFailure]: File "c:\users\josep\.virtualenvs\airbnb-clone-grekw6gp\lib\site-packages\pipenv\resolver.py", line 684, in resolve
[ResolutionFailure]: return resolve_deps(
[ResolutionFailure]: File "C:\Users\josep\.virtualenvs\Airbnb-Clone-GrEkW6GP\lib\site-packages\pipenv\utils.py", line 1395, in resolve_deps
[ResolutionFailure]: results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]: File "C:\Users\josep\.virtualenvs\Airbnb-Clone-GrEkW6GP\lib\site-packages\pipenv\utils.py", line 1108, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "C:\Users\josep\.virtualenvs\Airbnb-Clone-GrEkW6GP\lib\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 pathspec<1,==0.5.9,>=0.6 (from black==20.8b1->-r C:\Users\josep\AppData\Local\Temp\pipenvnt4vjek5requirements\pipenv-0sidr1ev-constraints.txt (line 4))
Tried: 0.2.2, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.4.0, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.5.6, 0.5.7, 0.5.8, 0.5.9, 0.6.0, 0.7.0, 0.7.0, 0.8.0, 0.8.0, 0.8.1, 0.8.1
There are incompatible versions in the resolved dependencies:
pathspec<1,>=0.6 (from black==20.8b1->-r C:\Users\josep\AppData\Local\Temp\pipenvnt4vjek5requirements\pipenv-0sidr1ev-constraints.txt (line 4))
pathspec==0.5.9 (from awsebcli==3.19.2->-r C:\Users\josep\AppData\Local\Temp\pipenvnt4vjek5requirements\pipenv-0sidr1ev-constraints.txt (line 3))
I searched about that a bit, and I tried quite many like pipenv lock,pipenv lock --clear,etc. But none of them working for me. And according to error, it seems that I'm having this error because of the version issue, but I've got no idea what pipenv want me to do to fix this. What should I do to fix this?

Related

pipenv install cannot find any packages

I cannot build a virutal environment using pipenv install, I always get the error No matching distribution found for aws-lambda-powertools if I remove that package I will get the same error for another package I have in there.
Stack trace (displayed when I try to build throgh pycharm)
Pipfile.lock (cb83d8) out of date, updating to (459cf8)...
Locking [packages] dependencies...
⠋ Locking...
Building requirements...
⠙ Locking...
Resolving dependencies...
⠹ Locking...
⠸ Locking...
⠼ Locking...✘ Locking Failed!
CRITICAL:pipenv.patched.pip._internal.resolution.resolvelib.factory:Could not find a version that satisfies the requirement aws-lambda-powertools (from versions: none)
[ResolutionFailure]: File "/Users/n0359100/Library/Python/3.9/lib/python/site-packages/pipenv/resolver.py", line 833, in _main
[ResolutionFailure]: resolve_packages(
[ResolutionFailure]: File "/Users/n0359100/Library/Python/3.9/lib/python/site-packages/pipenv/resolver.py", line 781, in resolve_packages
[ResolutionFailure]: results, resolver = resolve(
[ResolutionFailure]: File "/Users/n0359100/Library/Python/3.9/lib/python/site-packages/pipenv/resolver.py", line 760, in resolve
[ResolutionFailure]: return resolve_deps(
[ResolutionFailure]: File "/Users/n0359100/Library/Python/3.9/lib/python/site-packages/pipenv/utils/resolver.py", line 1103, in resolve_deps
[ResolutionFailure]: results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]: File "/Users/n0359100/Library/Python/3.9/lib/python/site-packages/pipenv/utils/resolver.py", line 892, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "/Users/n0359100/Library/Python/3.9/lib/python/site-packages/pipenv/utils/resolver.py", line 687, 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.
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: No matching distribution found for aws-lambda-powertools

Can't install a single dependency or activate virtualenv using pipenv

I have seen some similar questions but none of those answers fixed my problem.
So the thing is, i installed pipenv and tried to use it to be able to create a pipefile, but i can't, i also got one pair of pipefile and pipefile.lock and tried to install but whenever i try it gives me this:
for example, lets say i want to install requests
PS D:\Projetos\Python\shipay\backend-challenge\bot> pipenv install requests
Installing requests...
Pipfile.lock (d5437b) out of date, updating to (c4c73e)...
Locking [packages] dependencies...
[ =] Resolving dependencies...
ERROR:pip.subprocessor:[present-rich] python setup.py egg_info exited with 1
[ResolutionFailure]: File "C:/Users/leand/AppData/Roaming/Python/Python311/site-packages/pipenv/resolver.py", line 812, in _main
[ResolutionFailure]: pre, clear, verbose, system, write, requirements_dir, packages, category
[ResolutionFailure]: File "C:/Users/leand/AppData/Roaming/Python/Python311/site-packages/pipenv/resolver.py", line 767, in resolve_packages
[ResolutionFailure]: requirements_dir=requirements_dir,
[ResolutionFailure]: File "C:/Users/leand/AppData/Roaming/Python/Python311/site-packages/pipenv/resolver.py", line 747, in resolve
[ResolutionFailure]: req_dir=requirements_dir,
[ResolutionFailure]: File "C:/Users/leand/AppData/Roaming/Python/Python311/site-packages/pipenv\utils\resolver.py", line 1109, in resolve_deps
[ResolutionFailure]: req_dir=req_dir,
[ResolutionFailure]: File "C:/Users/leand/AppData/Roaming/Python/Python311/site-packages/pipenv\utils\resolver.py", line 899, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "C:/Users/leand/AppData/Roaming/Python/Python311/site-packages/pipenv\utils\resolver.py", line 687, 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.
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: metadata generation failed
Here's the Pipefile:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
apscheduler = "*"
flask = "*"
psycopg2 = "*"
flask-sqlalchemy = "*"
xlsxwriter = "*"
logging = "*"
requests = "*"
[requires]
python_version = "3.7"
i just got errors, i can't install a single one, and if i enter the pipenv install --skip-lock it doesn't show me nothing at all.
and the code pointed me: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
also, this line pipenv lock --pre --clear that i saw on other post does the same error above
what i need to do here? or am i missing something here?

installing mysqlclient locking failed

I am using python3.9 in django framework, for that I have to install mysqlclient. But error is coming when I try
pipenv install mysqlclient
output like this as error:
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV__VERBOSITY=-1 to suppress this warning. Installing mysqlclient... Adding mysqlclient to Pipfile's [packages]... Installation Succeeded Pipfile.lock (06f36b) out of date, updating to (f95eff)... Locking [dev-packages] dependencies... Locking [packages] dependencies...
Resolving dependencies... Locking Failed!
CRITICAL:pipenv.patched.notpip._internal.resolution.resolvelib.factory:Could not find a version that satisfies the requirement django (from versions: none)
[ResolutionFailure]: File "C:\Users\meghd\anaconda3\lib\site-packages\pipenv\resolver.py", line 743, in _main
[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]: File "C:\Users\meghd\anaconda3\lib\site-packages\pipenv\resolver.py", line 704, in resolve_packages
[ResolutionFailure]: results, resolver = resolve(
[ResolutionFailure]: File "C:\Users\meghd\anaconda3\lib\site-packages\pipenv\resolver.py", line 685, in resolve
[ResolutionFailure]: return resolve_deps(
[ResolutionFailure]: File "c:\users\meghd\anaconda3\lib\site-packages\pipenv\utils.py", line 1377, in resolve_deps
[ResolutionFailure]: results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]: File "c:\users\meghd\anaconda3\lib\site-packages\pipenv\utils.py", line 1106, in actually_resolve_deps
[ResolutionFailure]: resolver.resolve()
[ResolutionFailure]: File "c:\users\meghd\anaconda3\lib\site-packages\pipenv\utils.py", line 884, 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.
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: No matching distribution found for django```

I cannot install packages anymore with pipenv

Each time I want to do pipenv install the package is not installed.
I guess it is because of geckodriver but I don't know why.
Error:
✘ Locking Failed!
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/resolver.py", line 69, in resolve
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/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 geckodriver
[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 geckodriver
No versions found
Was https://pypi.org/simple reachable?
[pipenv.exceptions.ResolutionFailure]: req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]: req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]: resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]: File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/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 geckodriver
[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 geckodriver
No versions found
Was https://pypi.org/simple reachable?
Check your pipfile and pipfile.lock file. You probably don't have them present. You need to specify the package you want to install otherwise.

Unable to install Django with pipenv because of pytz package failure

This has caused problems for me when developing with django, the simplest case to reproduce this error follows.
I'm using Anaconda 4.6.4 running Python 3.6.5, pip version 19.0.3, and pipenv version 2018.11.26. I've updated all the packages, even tried to use previous versions of several packages.
When I use:
pipenv shell
I get a new virtual environment, then I try:
pipenv install django
I then get the following error message:
Installing django…
Adding django to Pipfile's [packages]…
Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Success!
Updated Pipfile.lock (85c883)!
Installing dependencies from Pipfile.lock (85c883)…
An error occurred while installing pytz==2018.9 --hash= ! Will try again.
================================ 2/2 - 00:00:01
Installing initially failed dependencies…
[pipenv.exceptions.InstallError]: File "c:\programdata\anaconda3\lib\site-packages\pipenv\core.py", line 1992, in do_install
[pipenv.exceptions.InstallError]: skip_lock=skip_lock,
[pipenv.exceptions.InstallError]: File "c:\programdata\anaconda3\lib\site-packages\pipenv\core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]: pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]: File "c:\programdata\anaconda3\lib\site-packages\pipenv\core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]: retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]: File "c:\programdata\anaconda3\lib\site-packages\pipenv\core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]: _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]: File "c:\programdata\anaconda3\lib\site-packages\pipenv\core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]: raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: []
[pipenv.exceptions.InstallError]: ['Usage: pip [options]', '', 'Invalid requirement: pytz==2018.9 --hash=\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'pip: error: Arguments to --hash must be a hash name followed by a value, like --hash=sha256:abcde...']
ERROR: ERROR: Package installation failed...
================================ 0/1 - 00:00:00
This occurs when I'm using command line, power shell, pycharm, atom editor. I've searched for similar errors online all over the place but can't find anything relevant to this. I tried looking at the pipenv source code for the batch_install and _clean_procs functions among others in the stack trace, but couldn't figure out why it's failing.

Categories