whenever i try to install a python package such as easyocr or transformers from the attached requirements.txt, i get the error as shown in the attached code snippet.
the contents of requirements.txt:
easyocr==1.7.1
matplotlib==3.9.1.post1
opencv-python-headless==4.10.0.84
the line below makes me think that there may be a problem with my python distribution, or permissions associated with it:
note: This error originates from a subprocess, and is likely not a problem with pip.
to solve the issue, i have tried the following:
- modifying user permissions in C:/Users/lenovo/AppData/Local/Temp
- installing the package with the –user flag
- upgrading pip with python -m pip install –upgrade pip: this fails in totality saying the wheel distribution isn’t supported
- installing the package outside my venv, which halts inordinately and i have to stop the execution
all of these still resulted in the error log below
$ pip install -r requirements.txt
WARNING: Ignoring invalid distribution -ip (c:/users/lenovo/onedrive - strathmore university/desktop/pythonprojects/tsh_cv/venv/lib/python3.10/site-packages)
Collecting easyocr==1.7.1 (from -r requirements.txt (line 1))
Using cached easyocr-1.7.1-py3-none-any.whl.metadata (11 kB)
Collecting matplotlib==3.9.1.post1 (from -r requirements.txt (line 2))
Downloading matplotlib-3.9.1.post1.tar.gz (36.1 MB)
---------------------------------------- 36.1/36.1 MB 2.3 MB/s eta 0:00:00
Installing build dependencies ... error
error: subprocess-exited-with-error
pip subprocess to install build dependencies did not run successfully.
exit code: 1
[60 lines of output]
Collecting meson-python>=0.13.1
Downloading meson_python-0.16.0-py3-none-any.whl.metadata (4.1 kB)
Collecting pybind11>=2.6
Downloading pybind11-2.13.1-py3-none-any.whl.metadata (9.5 kB)
Collecting setuptools_scm>=7
Downloading setuptools_scm-8.1.0-py3-none-any.whl.metadata (6.6 kB)
Collecting numpy<2.3,>=2.0.0rc1
Downloading numpy-2.0.1.tar.gz (18.9 MB)
---------------------------------------- 18.9/18.9 MB 2.7 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: still running...
Installing backend dependencies: still running...
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Preparing metadata (pyproject.toml) did not run successfully.
exit code: 1
[24 lines of output]
+ C:/Users/lenovo/OneDrive - Strathmore University/Desktop/PythonProjects/tsh_cv/venv/bin/python3.exe C:/Users/lenovo/AppData/Local/Temp/pip-install-vkcloeqi/numpy_905328b29e3b48ca93ae283cd8097d9a/vendored-meson/meson/meson.py setup C:/Users/lenovo/AppData/Local/Temp/pip-install-vkcloeqi/numpy_905328b29e3b48ca93ae283cd8097d9a C:/Users/lenovo/AppData/Local/Temp/pip-install-vkcloeqi/numpy_905328b29e3b48ca93ae283cd8097d9a/.mesonpy-45v6gfao -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:/Users/lenovo/AppData/Local/Temp/pip-install-vkcloeqi/numpy_905328b29e3b48ca93ae283cd8097d9a/.mesonpy-45v6gfao/meson-python-native-file.ini
The Meson build system
Version: 1.4.99
Source dir: C:/Users/lenovo/AppData/Local/Temp/pip-install-vkcloeqi/numpy_905328b29e3b48ca93ae283cd8097d9a
Build dir: C:/Users/lenovo/AppData/Local/Temp/pip-install-vkcloeqi/numpy_905328b29e3b48ca93ae283cd8097d9a/.mesonpy-45v6gfao
Build type: native build
Project name: NumPy
Project version: 2.0.1
C compiler for the host machine: cc (gcc 12.1.0 "cc (Rev3, Built by MSYS2 project) 12.1.0")
C linker for the host machine: cc ld.bfd 2.38
C++ compiler for the host machine: c++ (gcc 12.1.0 "c++ (Rev3, Built by MSYS2 project) 12.1.0")
C++ linker for the host machine: c++ ld.bfd 2.38
Cython compiler for the host machine: cython (cython 3.0.11)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python found: YES (C:/Users/lenovo/OneDrive - Strathmore University/Desktop/PythonProjects/tsh_cv/venv/bin/python3.exe)
Did not find pkg-config by name 'pkg-config'
Found pkg-config: NO
Could not find Python3 library 'C:/Users/lenovo/OneDrive - Strathmore University/Desktop/PythonProjects/tsh_cv/venv/lib/libpython3.10.dll.a'
Run-time dependency python found: NO (tried pkgconfig, pkgconfig and sysconfig)
../meson.build:41:12: ERROR: Python dependency not found
A full log can be found at C:/Users/lenovo/AppData/Local/Temp/pip-install-vkcloeqi/numpy_905328b29e3b48ca93ae283cd8097d9a/.mesonpy-45v6gfao/meson-logs/meson-log.txt
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
pip subprocess to install build dependencies did not run successfully.
exit code: 1
See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.