pypa / pipenv

Python Development Workflow for Humans.
https://pipenv.pypa.io
MIT License
24.92k stars 1.88k forks source link

RuntimeError: Failed to lock Pipfile.lock! #5997

Closed ChandanM1995 closed 1 year ago

ChandanM1995 commented 1 year ago

hi. this is the issue I am facing when I try to install Pipenv install mysqlclient for my Django project. can you please me?

`(demo) chandanm@Chandans-MacBook-Air demo % pipenv install mysqlclient Installing mysqlclient... Resolving mysqlclient... Added mysqlclient to Pipfile's [packages] ... ✔ Installation Succeeded Pipfile.lock (e35515) out of date, updating to (537503)... Locking [packages] dependencies... Building requirements... Resolving dependencies... ✘ Locking Failed! ⠸ Locking...False ERROR:pip.subprocessor:Getting requirements to build wheel exited with 1 ResolutionFailure: File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/resolver.py", line 645, in _main

ResolutionFailure: File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/resolver.py", line 612, in resolve_packages ResolutionFailure: results, resolver = resolve(

ResolutionFailure: File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/resolver.py", line 592, in resolve ResolutionFailure: return resolve_deps(

ResolutionFailure: File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 908, in resolve_deps ResolutionFailure: results, hashes, internal_resolver = actually_resolve_deps(

ResolutionFailure: File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 681, in actually_resolve_deps

ResolutionFailure: File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 442, 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 run pip install 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: Getting requirements to build wheel exited with 1

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/bin/pipenv", line 8, in sys.exit(cli()) ^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1157, in call return self.main(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/cli/options.py", line 58, in main return super().main(args, kwargs, windows_expand_args=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/vendor/click/decorators.py", line 92, in new_func return ctx.invoke(f, obj, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 783, in invoke return __callback(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/cli/command.py", line 209, in install do_install( File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/routines/install.py", line 297, in do_install raise e File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/routines/install.py", line 281, in do_install do_init( File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/routines/install.py", line 648, in do_init do_lock( File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/routines/lock.py", line 65, in do_lock venv_resolve_deps( File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 849, in venv_resolve_deps c = resolve(cmd, st, project=project) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 718, in resolve raise RuntimeError("Failed to lock Pipfile.lock!") RuntimeError: Failed to lock Pipfile.lock!`

matteius commented 1 year ago

@ChandanM1995 you are probably missing dev dependencies for mysqlclient. You could try to brew install mysql-client Does it work for you to pip install this package?

ChandanM1995 commented 1 year ago

hello @matteius . I tried. still getting the same error. chandanm@Chandans-MacBook-Air demoproject % brew install mysql-client ==> Downloading https://formulae.brew.sh/api/formula.jws.json ######################################################################################################### 100.0% ==> Downloading https://formulae.brew.sh/api/cask.jws.json ######################################################################################################### 100.0% Warning: mysql-client 8.1.0 is already installed and up-to-date. To reinstall 8.1.0, run: brew reinstall mysql-client (demoproject) chandanm@Chandans-MacBook-Air demoproject % pipenv install mysqlclient Installing mysqlclient... Resolving mysqlclient... Added mysqlclient to Pipfile's [packages] ... ✔ Installation Succeeded Pipfile.lock (e35515) out of date, updating to (537503)... Locking [packages] dependencies... Building requirements... Resolving dependencies... ✘ Locking Failed! ⠦ Locking...False ERROR:pip.subprocessor:Getting requirements to build wheel exited with 1 ResolutionFailure: File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/resolver.py", line 645, in _main

ResolutionFailure: File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/resolver.py", line 612, in resolve_packages ResolutionFailure: results, resolver = resolve(

ResolutionFailure: File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/resolver.py", line 592, in resolve ResolutionFailure: return resolve_deps(

ResolutionFailure: File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 908, in resolve_deps ResolutionFailure: results, hashes, internal_resolver = actually_resolve_deps(

ResolutionFailure: File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 681, in actually_resolve_deps

ResolutionFailure: File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 442, 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 run pip install 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: Getting requirements to build wheel exited with 1

Traceback (most recent call last): File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/bin/pipenv", line 8, in sys.exit(cli()) ^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1157, in call return self.main(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/cli/options.py", line 58, in main return super().main(args, kwargs, windows_expand_args=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/vendor/click/decorators.py", line 92, in new_func return ctx.invoke(f, obj, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/vendor/click/core.py", line 783, in invoke return __callback(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/cli/command.py", line 209, in install do_install( File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/routines/install.py", line 297, in do_install raise e File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/routines/install.py", line 281, in do_install do_init( File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/routines/install.py", line 648, in do_init do_lock( File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/routines/lock.py", line 65, in do_lock venv_resolve_deps( File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 849, in venv_resolve_deps c = resolve(cmd, st, project=project) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/chandanm/.local/share/virtualenvs/demoproject-2akF-KG0/lib/python3.12/site-packages/pipenv/utils/resolver.py", line 718, in resolve raise RuntimeError("Failed to lock Pipfile.lock!") RuntimeError: Failed to lock Pipfile.lock!

ChandanM1995 commented 1 year ago

@matteius

what I noticed was when I try to install Django-debug-toolbar using pipenv install Django_debug_toolbar, it works fine without any error. but when I try to install mysqlclient using the command pipenv install mysqlclient, I get the error.

✘ Locking Failed! ⠴ Locking…False ERROR:pip.subprocessor:Getting requirements to build wheel exited with 1

RuntimeError: Failed to lock Pipfile.lock I believe there might a an error in the mysqlclient package that I am trying to install.

matteius commented 1 year ago

Run with the --verbose flag.

ChandanM1995 commented 1 year ago

hi @matteius , what I did was, I tried to install the previous version of mysqlclient. that is pipenv install mysqlclient==2.1.1

and it worked. your help really means a lot. it made to thick and learn more. thank you very much again.