Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error from opencv-python dependency #53

Open
danbjoseph opened this issue Jun 17, 2024 · 2 comments
Open

Installation error from opencv-python dependency #53

danbjoseph opened this issue Jun 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@danbjoseph
Copy link
Member

danbjoseph commented Jun 17, 2024

using Python 3.12.3

below error occurs when running either make requirements or pip install -e .

(.venv) ➜  street-view-green-view git:(main) make requirements
python3 -m pip install -U pip setuptools wheel
Requirement already satisfied: pip in ./.venv/lib/python3.12/site-packages (24.0)
Collecting setuptools
  Downloading setuptools-70.0.0-py3-none-any.whl.metadata (5.9 kB)
Collecting wheel
  Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Downloading setuptools-70.0.0-py3-none-any.whl (863 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 863.4/863.4 kB 16.7 MB/s eta 0:00:00
Using cached wheel-0.43.0-py3-none-any.whl (65 kB)
Installing collected packages: wheel, setuptools
Successfully installed setuptools-70.0.0 wheel-0.43.0
python3 -m pip install -e .
Obtaining file:///Users/danbjoseph/GitHub/americanredcross/street-view-green-view
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting folium (from src==0.1.0)
  Downloading folium-0.17.0-py2.py3-none-any.whl.metadata (3.8 kB)
Collecting geopandas (from src==0.1.0)
  Downloading geopandas-0.14.4-py3-none-any.whl.metadata (1.5 kB)
Collecting geopy (from src==0.1.0)
  Using cached geopy-2.4.1-py3-none-any.whl.metadata (6.8 kB)
Collecting loguru (from src==0.1.0)
  Using cached loguru-0.7.2-py3-none-any.whl.metadata (23 kB)
Collecting mapclassify (from src==0.1.0)
  Using cached mapclassify-2.6.1-py3-none-any.whl.metadata (2.6 kB)
Collecting matplotlib (from src==0.1.0)
  Downloading matplotlib-3.9.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (11 kB)
Collecting numpy (from src==0.1.0)
  Downloading numpy-2.0.0-cp312-cp312-macosx_14_0_arm64.whl.metadata (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.9/60.9 kB 3.3 MB/s eta 0:00:00
Collecting opencv-python (from src==0.1.0)
  Downloading opencv-python-4.10.0.84.tar.gz (95.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 95.1/95.1 MB 31.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... 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 "/Users/danbjoseph/GitHub/americanredcross/street-view-green-view/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/danbjoseph/GitHub/americanredcross/street-view-green-view/.venv/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 "/Users/danbjoseph/GitHub/americanredcross/street-view-green-view/.venv/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 "/Users/danbjoseph/GitHub/americanredcross/street-view-green-view/.venv/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 "/opt/homebrew/Cellar/[email protected]/3.12.3/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 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 995, in exec_module
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "/private/var/folders/b6/3s_sztn53ls_77rt7bkhymy00000gn/T/pip-build-env-iut5akmj/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
          import setuptools.version
        File "/private/var/folders/b6/3s_sztn53ls_77rt7bkhymy00000gn/T/pip-build-env-iut5akmj/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
          import pkg_resources
        File "/private/var/folders/b6/3s_sztn53ls_77rt7bkhymy00000gn/T/pip-build-env-iut5akmj/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.
make: *** [requirements] Error 1

setting up a Python 3.11.9 environment
and it hangs on Building wheel for opencv-python (pyproject.toml) ...
EDIT: it eventually completed

➜  street-view-green-view git:(pr/46) python3.11 -m venv .venv
➜  street-view-green-view git:(pr/46) source .venv/bin/activate
(.venv) ➜  street-view-green-view git:(pr/46) python --version 
Python 3.11.9
(.venv) ➜  street-view-green-view git:(pr/46) pip install -e .                                 
Obtaining file:///Users/danbjoseph/GitHub/americanredcross/street-view-green-view
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting folium (from src==0.1.0)
  Using cached folium-0.17.0-py2.py3-none-any.whl.metadata (3.8 kB)
Collecting geopandas (from src==0.1.0)
  Using cached geopandas-0.14.4-py3-none-any.whl.metadata (1.5 kB)
Collecting mapclassify (from src==0.1.0)
  Using cached mapclassify-2.6.1-py3-none-any.whl.metadata (2.6 kB)
Collecting matplotlib (from src==0.1.0)
  Using cached matplotlib-3.9.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (11 kB)
Collecting numpy (from src==0.1.0)
  Using cached numpy-2.0.0-cp311-cp311-macosx_14_0_arm64.whl.metadata (60 kB)
Collecting ruff (from src==0.1.0)
  Using cached ruff-0.4.9-py3-none-macosx_11_0_arm64.whl.metadata (24 kB)
Collecting requests (from src==0.1.0)
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting shapely (from src==0.1.0)
  Using cached shapely-2.0.4-cp311-cp311-macosx_11_0_arm64.whl.metadata (7.0 kB)
Collecting typer (from src==0.1.0)
  Using cached typer-0.12.3-py3-none-any.whl.metadata (15 kB)
Collecting pandas (from src==0.1.0)
  Using cached pandas-2.2.2-cp311-cp311-macosx_11_0_arm64.whl.metadata (19 kB)
Collecting geopy (from src==0.1.0)
  Using cached geopy-2.4.1-py3-none-any.whl.metadata (6.8 kB)
Collecting tqdm (from src==0.1.0)
  Using cached tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
Collecting python-dotenv (from src==0.1.0)
  Using cached python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB)
Collecting scikit-image (from src==0.1.0)
  Using cached scikit_image-0.23.2-cp311-cp311-macosx_12_0_arm64.whl.metadata (14 kB)
Collecting opencv-python (from src==0.1.0)
  Using cached opencv-python-4.10.0.84.tar.gz (95.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting stamina (from src==0.1.0)
  Using cached stamina-24.2.0-py3-none-any.whl.metadata (4.7 kB)
Collecting h3pandas (from src==0.1.0)
  Using cached h3pandas-0.2.6-py3-none-any.whl
Collecting branca>=0.6.0 (from folium->src==0.1.0)
  Using cached branca-0.7.2-py3-none-any.whl.metadata (1.5 kB)
Collecting jinja2>=2.9 (from folium->src==0.1.0)
  Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting xyzservices (from folium->src==0.1.0)
  Using cached xyzservices-2024.6.0-py3-none-any.whl.metadata (4.0 kB)
Collecting fiona>=1.8.21 (from geopandas->src==0.1.0)
  Using cached fiona-1.9.6-cp311-cp311-macosx_11_0_arm64.whl.metadata (50 kB)
Collecting packaging (from geopandas->src==0.1.0)
  Using cached packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
Collecting pyproj>=3.3.0 (from geopandas->src==0.1.0)
  Using cached pyproj-3.6.1-cp311-cp311-macosx_11_0_arm64.whl.metadata (31 kB)
Collecting python-dateutil>=2.8.2 (from pandas->src==0.1.0)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz>=2020.1 (from pandas->src==0.1.0)
  Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.7 (from pandas->src==0.1.0)
  Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting geographiclib<3,>=1.52 (from geopy->src==0.1.0)
  Using cached geographiclib-2.0-py3-none-any.whl.metadata (1.4 kB)
Collecting h3 (from h3pandas->src==0.1.0)
  Using cached h3-3.7.7-cp311-cp311-macosx_11_0_arm64.whl.metadata (4.9 kB)
Collecting typing-extensions (from h3pandas->src==0.1.0)
  Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting networkx>=2.7 (from mapclassify->src==0.1.0)
  Using cached networkx-3.3-py3-none-any.whl.metadata (5.1 kB)
Collecting scikit-learn>=1.0 (from mapclassify->src==0.1.0)
  Using cached scikit_learn-1.5.0-cp311-cp311-macosx_12_0_arm64.whl.metadata (11 kB)
Collecting scipy>=1.8 (from mapclassify->src==0.1.0)
  Using cached scipy-1.13.1-cp311-cp311-macosx_12_0_arm64.whl.metadata (60 kB)
Collecting contourpy>=1.0.1 (from matplotlib->src==0.1.0)
  Using cached contourpy-1.2.1-cp311-cp311-macosx_11_0_arm64.whl.metadata (5.8 kB)
Collecting cycler>=0.10 (from matplotlib->src==0.1.0)
  Using cached cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
Collecting fonttools>=4.22.0 (from matplotlib->src==0.1.0)
  Using cached fonttools-4.53.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (162 kB)
Collecting kiwisolver>=1.3.1 (from matplotlib->src==0.1.0)
  Using cached kiwisolver-1.4.5-cp311-cp311-macosx_11_0_arm64.whl.metadata (6.4 kB)
Collecting pillow>=8 (from matplotlib->src==0.1.0)
  Using cached pillow-10.3.0-cp311-cp311-macosx_11_0_arm64.whl.metadata (9.2 kB)
Collecting pyparsing>=2.3.1 (from matplotlib->src==0.1.0)
  Using cached pyparsing-3.1.2-py3-none-any.whl.metadata (5.1 kB)
Collecting charset-normalizer<4,>=2 (from requests->src==0.1.0)
  Using cached charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl.metadata (33 kB)
Collecting idna<4,>=2.5 (from requests->src==0.1.0)
  Using cached idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests->src==0.1.0)
  Using cached urllib3-2.2.2-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests->src==0.1.0)
  Using cached certifi-2024.6.2-py3-none-any.whl.metadata (2.2 kB)
Collecting imageio>=2.33 (from scikit-image->src==0.1.0)
  Using cached imageio-2.34.1-py3-none-any.whl.metadata (4.9 kB)
Collecting tifffile>=2022.8.12 (from scikit-image->src==0.1.0)
  Using cached tifffile-2024.5.22-py3-none-any.whl.metadata (30 kB)
Collecting lazy-loader>=0.4 (from scikit-image->src==0.1.0)
  Using cached lazy_loader-0.4-py3-none-any.whl.metadata (7.6 kB)
Collecting tenacity (from stamina->src==0.1.0)
  Using cached tenacity-8.4.1-py3-none-any.whl.metadata (1.2 kB)
Collecting click>=8.0.0 (from typer->src==0.1.0)
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting shellingham>=1.3.0 (from typer->src==0.1.0)
  Using cached shellingham-1.5.4-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting rich>=10.11.0 (from typer->src==0.1.0)
  Using cached rich-13.7.1-py3-none-any.whl.metadata (18 kB)
Collecting attrs>=19.2.0 (from fiona>=1.8.21->geopandas->src==0.1.0)
  Using cached attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
Collecting click-plugins>=1.0 (from fiona>=1.8.21->geopandas->src==0.1.0)
  Using cached click_plugins-1.1.1-py2.py3-none-any.whl.metadata (6.4 kB)
Collecting cligj>=0.5 (from fiona>=1.8.21->geopandas->src==0.1.0)
  Using cached cligj-0.7.2-py3-none-any.whl.metadata (5.0 kB)
Collecting six (from fiona>=1.8.21->geopandas->src==0.1.0)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting MarkupSafe>=2.0 (from jinja2>=2.9->folium->src==0.1.0)
  Using cached MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl.metadata (3.0 kB)
Collecting markdown-it-py>=2.2.0 (from rich>=10.11.0->typer->src==0.1.0)
  Using cached markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich>=10.11.0->typer->src==0.1.0)
  Using cached pygments-2.18.0-py3-none-any.whl.metadata (2.5 kB)
Collecting joblib>=1.2.0 (from scikit-learn>=1.0->mapclassify->src==0.1.0)
  Using cached joblib-1.4.2-py3-none-any.whl.metadata (5.4 kB)
Collecting threadpoolctl>=3.1.0 (from scikit-learn>=1.0->mapclassify->src==0.1.0)
  Using cached threadpoolctl-3.5.0-py3-none-any.whl.metadata (13 kB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich>=10.11.0->typer->src==0.1.0)
  Using cached mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Using cached folium-0.17.0-py2.py3-none-any.whl (108 kB)
Using cached geopandas-0.14.4-py3-none-any.whl (1.1 MB)
Using cached numpy-2.0.0-cp311-cp311-macosx_14_0_arm64.whl (5.2 MB)
Using cached pandas-2.2.2-cp311-cp311-macosx_11_0_arm64.whl (11.3 MB)
Using cached shapely-2.0.4-cp311-cp311-macosx_11_0_arm64.whl (1.3 MB)
Using cached geopy-2.4.1-py3-none-any.whl (125 kB)
Using cached mapclassify-2.6.1-py3-none-any.whl (38 kB)
Using cached matplotlib-3.9.0-cp311-cp311-macosx_11_0_arm64.whl (7.8 MB)
Using cached python_dotenv-1.0.1-py3-none-any.whl (19 kB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Using cached ruff-0.4.9-py3-none-macosx_11_0_arm64.whl (8.2 MB)
Using cached scikit_image-0.23.2-cp311-cp311-macosx_12_0_arm64.whl (13.3 MB)
Using cached stamina-24.2.0-py3-none-any.whl (14 kB)
Using cached tqdm-4.66.4-py3-none-any.whl (78 kB)
Using cached typer-0.12.3-py3-none-any.whl (47 kB)
Using cached branca-0.7.2-py3-none-any.whl (25 kB)
Using cached certifi-2024.6.2-py3-none-any.whl (164 kB)
Using cached charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl (118 kB)
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached contourpy-1.2.1-cp311-cp311-macosx_11_0_arm64.whl (245 kB)
Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
Using cached fiona-1.9.6-cp311-cp311-macosx_11_0_arm64.whl (13.9 MB)
Using cached fonttools-4.53.0-cp311-cp311-macosx_11_0_arm64.whl (2.2 MB)
Using cached geographiclib-2.0-py3-none-any.whl (40 kB)
Using cached idna-3.7-py3-none-any.whl (66 kB)
Using cached imageio-2.34.1-py3-none-any.whl (313 kB)
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Using cached kiwisolver-1.4.5-cp311-cp311-macosx_11_0_arm64.whl (66 kB)
Using cached lazy_loader-0.4-py3-none-any.whl (12 kB)
Using cached networkx-3.3-py3-none-any.whl (1.7 MB)
Using cached packaging-24.1-py3-none-any.whl (53 kB)
Using cached pillow-10.3.0-cp311-cp311-macosx_11_0_arm64.whl (3.4 MB)
Using cached pyparsing-3.1.2-py3-none-any.whl (103 kB)
Using cached pyproj-3.6.1-cp311-cp311-macosx_11_0_arm64.whl (4.9 MB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Using cached rich-13.7.1-py3-none-any.whl (240 kB)
Using cached scikit_learn-1.5.0-cp311-cp311-macosx_12_0_arm64.whl (11.0 MB)
Using cached scipy-1.13.1-cp311-cp311-macosx_12_0_arm64.whl (30.3 MB)
Using cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)
Using cached tifffile-2024.5.22-py3-none-any.whl (225 kB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
Using cached h3-3.7.7-cp311-cp311-macosx_11_0_arm64.whl (984 kB)
Using cached tenacity-8.4.1-py3-none-any.whl (27 kB)
Using cached xyzservices-2024.6.0-py3-none-any.whl (83 kB)
Using cached attrs-23.2.0-py3-none-any.whl (60 kB)
Using cached click_plugins-1.1.1-py2.py3-none-any.whl (7.5 kB)
Using cached cligj-0.7.2-py3-none-any.whl (7.1 kB)
Using cached joblib-1.4.2-py3-none-any.whl (301 kB)
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Using cached MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl (18 kB)
Using cached pygments-2.18.0-py3-none-any.whl (1.2 MB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached threadpoolctl-3.5.0-py3-none-any.whl (18 kB)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Building wheels for collected packages: src, opencv-python
  Building editable for src (pyproject.toml) ... done
  Created wheel for src: filename=src-0.1.0-py3-none-any.whl size=5739 sha256=cd08c066a11f8b8f583bebbf07fa74db4e69a73cd9d47dc52b31c08aecf37c4e
  Stored in directory: /private/var/folders/b6/3s_sztn53ls_77rt7bkhymy00000gn/T/pip-ephem-wheel-cache-mczv3va6/wheels/92/93/c6/4b602d55712b20c6c7bc3f0e77a9883748f0295081a4f4653e
  Building wheel for opencv-python (pyproject.toml) ... -
@jayqi
Copy link
Contributor

jayqi commented Jun 18, 2024

This looks like a bug with one of our dependencies, opencv-python: opencv/opencv-python#988

@sibocw
Copy link

sibocw commented Jun 19, 2024

I had a similar issue on a different project. I was able to fix it (temporarily) by:

  • pip uninstall opencv-python if one exists already
  • Install opencv-python manually, removing the strict dependency on setuptools==59.2.0:
    • git clone https://github.com/opencv/opencv-python.git
    • cd opencv-python
    • Remove the line setuptools==59.2.0
    • pip install setuptools to install an up-to-date version of setuptools manually (mine was 70.0.0)
    • pip install . to install opencv-python from the local copy
  • Then continue installation as usual

@jayqi jayqi changed the title fail on make requirements Installation error from opencv-python dependency Jul 10, 2024
@jayqi jayqi added the bug Something isn't working label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants