-1
Installing mysqlclient...
Resolving mysqlclient...
Adding mysqlclient to Pipfile's [packages] ...
✔ Installation Succeeded
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
Resolving dependencies...
✘ Locking Failed!
⠴ Locking...
ERROR:pip.subprocessor:[present-rich] Getting requirements to build wheel exited with 1
[ResolutionFailure]:   File "/home/deepak-budha/.local/lib/python3.10/site-packages/pipenv/resolver.py", line 704, in _main
[ResolutionFailure]:       resolve_packages(
[ResolutionFailure]:   File "/home/deepak-budha/.local/lib/python3.10/site-packages/pipenv/resolver.py", line 662, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:   File "/home/deepak-budha/.local/lib/python3.10/site-packages/pipenv/resolver.py", line 642, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:   File "/home/deepak-budha/.local/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 1167, in resolve_deps
[ResolutionFailure]:       results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]:   File "/home/deepak-budha/.local/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 948, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "/home/deepak-budha/.local/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 690, 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 <requirement_name> 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

I've used this command "sudo apt-get install python3-dev default-libmysqlclient-dev build-essential" and tried to install mysqlclient. But I get the same error. How can I fix it?

halfer
  • 19,824
  • 17
  • 99
  • 186
  • Regarding the close reason: two votes were for "not relating to programming", whereas I think this is missing a [mcve]. – halfer Aug 28 '23 at 20:59

1 Answers1

0

I had this problem too, and fixed it by running these commands(I think you haven't tried installing libssl-dev according to your explanations):
sudo apt update
sudo apt install python<version>-dev build-essential => eg. python3.10-dev
sudo apt install libssl-dev
sudo apt install libmysqlclient-dev
If it didn't work for you, check this and this out. I hope you find it useful.

  • Thanks erfan. I've run all the above mentioned comments. Those are already installed. Then I ran "pipenv install mysqlclient" command again and got the same error. Then I ran "sudo apt-get install python3-dev default-libmysqlclient-dev build-essential pkg-config" command and then ran "pipenv install mysqlclient" command again. Now I get a different error. Here it is: ValueError: "Requirement" object has no field "use_pep517" – Deepak Budha Aug 27 '23 at 14:18
  • I ran "pipenv lock" command and this error " ValueError: "Requirement" object has no field "use_pep517"" got fixed. I think it's fixed now. I can see mysqlclient = "*" under [packages] in Pipfile now. – Deepak Budha Aug 27 '23 at 14:55
  • Your welcome @DeepakBudha! Good luck. – erfan_rfmhr Aug 28 '23 at 09:02