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

pip install vars-gridview fails with python 3.12 #77

Open
hohonuuli opened this issue Jun 10, 2024 · 4 comments
Open

pip install vars-gridview fails with python 3.12 #77

hohonuuli opened this issue Jun 10, 2024 · 4 comments
Assignees

Comments

@hohonuuli
Copy link
Member

hohonuuli commented Jun 10, 2024

The pip install fails with Python 3.12 due to the removal of the long-deprecated pkgutil.ImpImporter class. Note that this is a pip issue and is not specific to vars-gridview. I found some notes here but the proposed workarounds did not fix the issue. Downgrading to 3.11 worked fine.

Steps to reproduce:

conda create -n vars-gridview python=3.12
conda activate vars-gridview
pip install vars-gridview

Output

Collecting vars-gridview
  Downloading vars_gridview-0.12.1-py3-none-any.whl.metadata (2.5 kB)
Collecting beholder-client<0.2.0,>=0.1.0 (from vars-gridview)
  Downloading beholder_client-0.1.0-py3-none-any.whl.metadata (1.5 kB)
Collecting dreamsim<0.2.0,>=0.1.3 (from vars-gridview)
  Downloading dreamsim-0.1.3-py3-none-any.whl.metadata (7.5 kB)
Collecting opencv-python<5.0.0.0,>=4.5.5.62 (from vars-gridview)
  Downloading opencv-python-4.10.0.82.tar.gz (95.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 95.1/95.1 MB 35.9 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 "/opt/miniconda3/envs/vars-gridview/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/miniconda3/envs/vars-gridview/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 "/opt/miniconda3/envs/vars-gridview/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 "/opt/miniconda3/envs/vars-gridview/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/miniconda3/envs/vars-gridview/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/zn/j87g9m_s1jz2gnm_g0r_s53h0000gn/T/pip-build-env-nl1z61jp/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
          import setuptools.version
        File "/private/var/folders/zn/j87g9m_s1jz2gnm_g0r_s53h0000gn/T/pip-build-env-nl1z61jp/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
          import pkg_resources
        File "/private/var/folders/zn/j87g9m_s1jz2gnm_g0r_s53h0000gn/T/pip-build-env-nl1z61jp/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.
@kevinsbarnard
Copy link
Collaborator

This seems to be an issue with the build of opencv-python on Apple Silicon. I followed the steps you provided on my machine (Linux 6.5.0-35-generic with conda 24.5.0) without issue.

Is there a possibility to use the bundled application? I haven't built one for the latest version (v0.12.1) but I can get on that... but it may be worth trying an earlier version (e.g. v0.11.0) to test as the VL has had success with this approach.

@hohonuuli
Copy link
Member Author

I was able to get it to build on python 3.11, but I can try the v0.11.0 on OSU's hardware too. The catch is that they are running on postgres.

@kwalz
Copy link

kwalz commented Aug 5, 2024

This is still an issue for Larissa's machine as well, we'd like to have the bundled app for V0.12.1 when available, thanks so much!

@lonnylundsten
Copy link

@kevinsbarnard I think this issue is resolved? One thing I have found is that one of the required libraries, pymssql, doesn't install correctly so if one were to install using a requirements.txt it might appear to have installed pymmsql correctly but ay not have. Also it may depend upon python version and whether a user is using an intel or apple silicon.

To fix the pymssql issue, I 'pip uninstall pymssql' and then 'pip install pymssql --no-binary :all:'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants