Issues installing pip packages

210 views Asked by At

I am neew to python and having issues installing some packages. It seems that the dependencies cannot be installed? I have tried everything that I could find online aand pip seems to be installed:

Santiagos-MacBook-Pro:~ sdeambrosi$ pip --version
pip 23.3.1 from /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip (python 3.12)

but I keep getting this error, even when I try to install them independently:

Santiagos-MacBook-Pro:~ sdeambrosi$ pip install layoutparser 
Collecting layoutparser   
Using cached layoutparser-0.3.4-py3-none-any.whl (19.2 MB) 
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from layoutparser) (1.26.2) 
Collecting opencv-python (from layoutparser)   
Using cached opencv-python-4.8.1.78.tar.gz (92.1 MB)   
Installing build dependencies ... error   error: subprocess-exited-with-error
     × pip subprocess to install build dependencies did not run successfully.   │ exit code: 1   ╰─> [64 lines of output]
      Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
      Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "darwin" and platform_machine == "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.9" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.10" and platform_system != "Darwin"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Darwin"' don't match your environment
      Collecting cmake>=3.1
        Using cached cmake-3.27.7-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl.metadata (6.7 kB)
      Collecting numpy==1.22.2
        Using cached numpy-1.22.2.zip (11.4 MB)
        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 'error'
        error: subprocess-exited-with-error
      
        × Getting requirements to build wheel did not run successfully.
        │ exit code: 1
        ╰─> [33 lines of output]
            Traceback (most recent call last):
              File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
                main()
              File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
                json_out['return_val'] = hook(**hook_input['kwargs'])
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
                backend = _build_backend()
                          ^^^^^^^^^^^^^^^^
              File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
                obj = import_module(mod_path)
                      ^^^^^^^^^^^^^^^^^^^^^^^
              File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
                return _bootstrap._gcd_import(name[level:], package, level)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
              File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
              File "<frozen importlib._bootstrap>", line 1304, in _find_and_load_unlocked
              File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
              File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
              File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
              File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
              File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
              File "<frozen importlib._bootstrap_external>", line 994, in exec_module
              File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
              File "/private/var/folders/y1/grngwvnn2qlgq6tf70pc942r0000gn/T/pip-build-env-a7umkkra/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
                import setuptools.version
              File "/private/var/folders/y1/grngwvnn2qlgq6tf70pc942r0000gn/T/pip-build-env-a7umkkra/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
                import pkg_resources
              File "/private/var/folders/y1/grngwvnn2qlgq6tf70pc942r0000gn/T/pip-build-env-a7umkkra/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>
                register_finder(pkgutil.ImpImporter, find_on_path)
                                ^^^^^^^^^^^^^^^^^^^
            AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: subprocess-exited-with-error
      
      × Getting requirements to build wheel 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.
      [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. Santiagos-MacBook-Pro:~ sdeambrosi$

I really don't know what else to do.

0

There are 0 answers