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

PyPI installation aborts with error (again) #213

Closed
starsforeveryone opened this issue Nov 29, 2022 · 12 comments
Closed

PyPI installation aborts with error (again) #213

starsforeveryone opened this issue Nov 29, 2022 · 12 comments
Labels
duplicate This issue or pull request already exists

Comments

@starsforeveryone
Copy link

When trying to install DisplayCAL on the latest Fedora 37, I'm getting the following error message:

Command: sudo pip install displaycal

Output:

Collecting displaycal
  Using cached DisplayCAL-3.9.10.tar.gz (10.7 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting build
  Using cached build-0.9.0-py3-none-any.whl (17 kB)
Requirement already satisfied: certifi in /usr/lib/python3.11/site-packages (from displaycal) (2021.10.8)
Requirement already satisfied: distro in /usr/lib/python3.11/site-packages (from displaycal) (1.7.0)
Requirement already satisfied: numpy in /usr/lib64/python3.11/site-packages (from displaycal) (1.22.0)
Requirement already satisfied: Pillow in /usr/lib64/python3.11/site-packages (from displaycal) (9.2.0)
Collecting PyChromecast
  Using cached PyChromecast-13.0.1-py2.py3-none-any.whl (62 kB)
Collecting Send2Trash
  Using cached Send2Trash-1.8.0-py3-none-any.whl (18 kB)
Collecting wxPython
  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-3y4j3r_t/wxpython_c518ab61ce2346798d23f31a3769d9c6/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-3y4j3r_t/wxpython_c518ab61ce2346798d23f31a3769d9c6/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
        File "/usr/local/lib/python3.11/site-packages/attrdict/__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "/usr/local/lib/python3.11/site-packages/attrdict/mapping.py", line 4, in <module>
          from collections import Mapping
      ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib64/python3.11/collections/__init__.py)
      [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.

Thanks for fixing!

@p5k369
Copy link
Collaborator

p5k369 commented Dec 5, 2022

Hey @starsforeveryone, we can't fix that.
You are failing to build wxPython on your system. There is already an issue from somebody having the same issue on fedora36, maybe you can try the suggestions made in #174 (comment) and give feedback if that solved your problem.

@p5k369 p5k369 added the duplicate This issue or pull request already exists label Dec 5, 2022
@p5k369
Copy link
Collaborator

p5k369 commented Dec 5, 2022

Duplicate of #174

@p5k369 p5k369 marked this as a duplicate of #174 Dec 5, 2022
@starsforeveryone
Copy link
Author

Can you restrict wxPython to 4.1.1 in the pip requirements file? Since the issue seems to originate there, and no functionality is lost, we could probably get it working for everybody this way! :)

@starsforeveryone
Copy link
Author

starsforeveryone commented Dec 6, 2022

Update: Did get it working! On Fedora 37, I had to:
sudo dnf install gtk3-devel python3-wxpython4 libXxf86vm-devel

That installed:

  • The gtk3 development files
  • The libXxf86vm development files, which are important since they contain xf86vmode
  • The package python3-wxpython4-4.2.0-2.fc37.x86_64.rpm, which confusingly is exactly the version that failed to install via pip before?

Then I was able to run
pip install displaycal
succesfully.

Now everything is installed but DisplayCAL refuses to start because my Python version is too new, lol -.-
RuntimeError: Need Python version >= 3.8 <= 3.10, got 3.11.0

Is this indeed the case, so DisplayCAL doesn't work with Python 3.11, or is it another bug?

@p5k369
Copy link
Collaborator

p5k369 commented Dec 6, 2022

@starsforeveryone if you choose to use pre-build wheels the python version you are using has to match the python version they were build for.
That doesn't seem the case here. You won't find any official wheels of wxpython-4.2.0 for python-3.11 on linux yet. You can try the wheels that I build for the ubuntu test pipelines, but I doubt they will work for you. https://wxpython.p5k.org/

It is not Displaycal that refuses to start, it's wxpython.

You're best bet is to build them by yourself and you are already half way there, try to reinstall wxpython with pip and the argument --no-cache-dir.

Can you restrict wxPython to 4.1.1 in the pip requirements file?

You can do that by yourself but you will not get it working that way. First, you won't find any pre-build wheels for wxpython-4.1.1 and python-3.11 and second you will not be able to build them by yourself. As far as I can tell python-3.11 is not comaptible with wxpython-4.1.1. The problems you get will be something like: https://discuss.python.org/t/python-3-11-frame-structure-and-various-changes/17895

Using python-3.10 would work and you are also losing no functionality.

@p5k369
Copy link
Collaborator

p5k369 commented Dec 6, 2022

That doesn't seem the case here.

I have to take this back. I took a look at the rpm and it seems that it is indeed build for python-3.11, maybe the ouptut is from another package. But it is not from DisplayCal.

@starsforeveryone
Copy link
Author

Thanks for your help! I'll try and look into it further once I got the time.

The error message comes when typing
displaycal
on the GNOME-Terminal.

Complete terminal output after that:

Traceback (most recent call last):
  File "/home/xxxxxxx/.local/bin/displaycal", line 4, in <module>
    from DisplayCAL.main import main
  File "/home/xxxxxxx/.local/lib/python3.11/site-packages/DisplayCAL/main.py", line 27, in <module>
    raise RuntimeError(
RuntimeError: Need Python version >= 3.8 <= 3.10, got 3.11.0

Maybe this helps? It really looks like an error from displaycal itself?

@p5k369
Copy link
Collaborator

p5k369 commented Dec 8, 2022

True. Change line 65 in meta.py to py_maxversion = (3, 11).

@starsforeveryone
Copy link
Author

still not fixed

@Sergij-SApcPro
Copy link

Sergij-SApcPro commented Dec 21, 2022

I don't know if it's related, but I tried with py_maxversion = (3, 11) and it throwed this error:

Traceback (most recent call last): File "/home/user/.local/lib/python3.11/site-packages/DisplayCAL/main.py", line 549, in main _main(module, name, app_lock_file_name) File "/home/user/.local/lib/python3.11/site-packages/DisplayCAL/main.py", line 466, in _main from DisplayCAL.wxwindows import BaseApp File "/home/user/.local/lib/python3.11/site-packages/DisplayCAL/wxwindows.py", line 28, in <module> from DisplayCAL import ICCProfile as ICCP File "/home/user/.local/lib/python3.11/site-packages/DisplayCAL/ICCProfile.py", line 51, in <module> from DisplayCAL import edid File "/home/user/.local/lib/python3.11/site-packages/DisplayCAL/edid.py", line 43, in <module> from DisplayCAL import RealDisplaySizeMM as RDSMM File "/home/user/.local/lib/python3.11/site-packages/DisplayCAL/RealDisplaySizeMM.py", line 45, in <module> _GetXRandROutputXID = GetXRandROutputXID ^^^^^^^^^^^^^^^^^^ NameError: name 'GetXRandROutputXID' is not defined

@p5k369
Copy link
Collaborator

p5k369 commented Dec 21, 2022

Hey @Sergij-SApcPro, this issue has already been fixed 2 weeks ago with these commits: 3762e7b and 97f0c91
As you can also read here: #218

If you want to install via pip you have to apply those changes by yourself because I am not able to release and publish a pypi package nor will I push to the main branch. Or you just follow our install instructions. Make sure to checkout the develop branch.

@starsforeveryone
Copy link
Author

starsforeveryone commented Dec 22, 2022

So this issue is fixed and we just have to wait for a new PyPi release (or build it ourselves)? Thank you! :) I'll mark as fixed then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants