pipenv install ERROR: Couldn't install package: {}

414 Views Asked by At

I am trying to run a pipenv install command on my ubuntu 22.04 wsl and keep getting this error. I have looked up online and didn't find anything useful. Does anyone knows how to solve it?

First, I run pip3 install pipenv succesfully. After running pipenv install I get the following:

Installing dependencies from Pipfile.lock (ccbde9)...
[pipenv.exceptions.InstallError]: Collecting mysqlclient==2.2.0 (from -r /tmp/pipenv-nctfx03x-requirements/pipenv-zco7ngoc-hashed-reqs.txt (line 1))
[pipenv.exceptions.InstallError]:   Using cached mysqlclient-2.2.0.tar.gz (89 kB)
[pipenv.exceptions.InstallError]:   Installing build dependencies: started
[pipenv.exceptions.InstallError]:   Installing build dependencies: finished with status 'done'
[pipenv.exceptions.InstallError]:   Getting requirements to build wheel: started
[pipenv.exceptions.InstallError]:   Getting requirements to build wheel: finished with status 'error'
[pipenv.exceptions.InstallError]: error: subprocess-exited-with-error
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:   × Getting requirements to build wheel did not run successfully.
[pipenv.exceptions.InstallError]:   │ exit code: 1
[pipenv.exceptions.InstallError]:   ╰─> [24 lines of output]
[pipenv.exceptions.InstallError]:       /bin/sh: 1: pkg-config: not found
[pipenv.exceptions.InstallError]:       /bin/sh: 1: pkg-config: not found
[pipenv.exceptions.InstallError]:       Trying pkg-config --exists mysqlclient
[pipenv.exceptions.InstallError]:       Command 'pkg-config --exists mysqlclient' returned non-zero exit status 127.
[pipenv.exceptions.InstallError]:       Trying pkg-config --exists mariadb
[pipenv.exceptions.InstallError]:       Command 'pkg-config --exists mariadb' returned non-zero exit status 127.
[pipenv.exceptions.InstallError]:       Traceback (most recent call last):
[pipenv.exceptions.InstallError]:         File "/home/naluh/.local/share/virtualenvs/Otimizador_de_Calendario-e6nrz_ZD/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
[pipenv.exceptions.InstallError]:           main()
[pipenv.exceptions.InstallError]:         File "/home/naluh/.local/share/virtualenvs/Otimizador_de_Calendario-e6nrz_ZD/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
[pipenv.exceptions.InstallError]:           json_out['return_val'] = hook(**hook_input['kwargs'])
[pipenv.exceptions.InstallError]:         File "/home/naluh/.local/share/virtualenvs/Otimizador_de_Calendario-e6nrz_ZD/lib/python3.10/site-packages/pipenv/patched/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
[pipenv.exceptions.InstallError]:           return hook(config_settings)
[pipenv.exceptions.InstallError]:         File "/tmp/pip-build-env-8qoay59q/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
[pipenv.exceptions.InstallError]:           return self._get_build_requires(config_settings, requirements=['wheel'])
[pipenv.exceptions.InstallError]:         File "/tmp/pip-build-env-8qoay59q/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
[pipenv.exceptions.InstallError]:           self.run_setup()
[pipenv.exceptions.InstallError]:         File "/tmp/pip-build-env-8qoay59q/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup
[pipenv.exceptions.InstallError]:           exec(code, locals())
[pipenv.exceptions.InstallError]:         File "<string>", line 154, in <module>
[pipenv.exceptions.InstallError]:         File "<string>", line 48, in get_config_posix
[pipenv.exceptions.InstallError]:         File "<string>", line 27, in find_package_name
[pipenv.exceptions.InstallError]:       Exception: Can not find valid pkg-config name.
[pipenv.exceptions.InstallError]:       Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
[pipenv.exceptions.InstallError]:       [end of output]
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:   note: This error originates from a subprocess, and is likely not a problem with pip.[pipenv.exceptions.InstallError]: error: subprocess-exited-with-error
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]: × Getting requirements to build wheel did not run successfully.
[pipenv.exceptions.InstallError]: │ exit code: 1
[pipenv.exceptions.InstallError]: ╰─> See above for output.
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]: note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Couldn't install package: {}
 Package installation failed...
0

There are 0 best solutions below