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

64-bit install failing #5

Closed
aaronr8684 opened this issue Feb 14, 2022 · 13 comments
Closed

64-bit install failing #5

aaronr8684 opened this issue Feb 14, 2022 · 13 comments

Comments

@aaronr8684
Copy link
Collaborator

aaronr8684 commented Feb 14, 2022

Same as the issue #48. 32-bit (Bullseye) works fine, but in the 64-bit version, something in the PyCairo dependency is causing the script to fail.

I think the quick and dirty fix would be to check if the OS is 64-bit and the PyCairo dependency is listed in the Pipfile. If it is, just do a quick sudo apt install pycairo2-dev

Alternatively, we could try to track down what is failing or why and see if their is a cleaner fix. There seems to be hint at PATH variables and obsolete installation methods, but a quick search doesn't turn up much.

pipenv install pycairo ouput:

Installing initially failed dependencies...
[pipenv.exceptions.InstallError]: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[pipenv.exceptions.InstallError]: Collecting pycairo
[pipenv.exceptions.InstallError]:   Using cached pycairo-1.20.1.tar.gz (344 kB)
[pipenv.exceptions.InstallError]:   Preparing metadata (setup.py): started
[pipenv.exceptions.InstallError]:   Preparing metadata (setup.py): finished with status 'done'
[pipenv.exceptions.InstallError]: Building wheels for collected packages: pycairo
[pipenv.exceptions.InstallError]:   Building wheel for pycairo (setup.py): started
[pipenv.exceptions.InstallError]:   Building wheel for pycairo (setup.py): finished with status 'error'
[pipenv.exceptions.InstallError]:   Running setup.py clean for pycairo
[pipenv.exceptions.InstallError]: Failed to build pycairo
[pipenv.exceptions.InstallError]: Installing collected packages: pycairo
[pipenv.exceptions.InstallError]:   Running setup.py install for pycairo: started
[pipenv.exceptions.InstallError]:   Running setup.py install for pycairo: finished with status 'error'
[pipenv.exceptions.InstallError]: error: subprocess-exited-with-error
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:   × python setup.py bdist_wheel did not run successfully.
[pipenv.exceptions.InstallError]:   │ exit code: 1
[pipenv.exceptions.InstallError]:   ╰─> [11 lines of output]
[pipenv.exceptions.InstallError]:       running bdist_wheel
[pipenv.exceptions.InstallError]:       running build
[pipenv.exceptions.InstallError]:       running build_py
[pipenv.exceptions.InstallError]:       warning: build_py: byte-compiling is disabled, skipping.
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:       running build_ext
[pipenv.exceptions.InstallError]:       Package cairo was not found in the pkg-config search path.
[pipenv.exceptions.InstallError]:       Perhaps you should add the directory containing `cairo.pc'
[pipenv.exceptions.InstallError]:       to the PKG_CONFIG_PATH environment variable
[pipenv.exceptions.InstallError]:       No package 'cairo' found
[pipenv.exceptions.InstallError]:       Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
[pipenv.exceptions.InstallError]:       [end of output]
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:   note: This error originates from a subprocess, and is likely not a problem with pip.
[pipenv.exceptions.InstallError]:   ERROR: Failed building wheel for pycairo
[pipenv.exceptions.InstallError]:   error: subprocess-exited-with-error
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:   × Running setup.py install for pycairo did not run successfully.
[pipenv.exceptions.InstallError]:   │ exit code: 1
[pipenv.exceptions.InstallError]:   ╰─> [13 lines of output]
[pipenv.exceptions.InstallError]:       running install
[pipenv.exceptions.InstallError]:       /usr/local/paperpi/.venv/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
[pipenv.exceptions.InstallError]:         warnings.warn(
[pipenv.exceptions.InstallError]:       running build
[pipenv.exceptions.InstallError]:       running build_py
[pipenv.exceptions.InstallError]:       warning: build_py: byte-compiling is disabled, skipping.
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:       running build_ext
[pipenv.exceptions.InstallError]:       Package cairo was not found in the pkg-config search path.
[pipenv.exceptions.InstallError]:       Perhaps you should add the directory containing `cairo.pc'
[pipenv.exceptions.InstallError]:       to the PKG_CONFIG_PATH environment variable
[pipenv.exceptions.InstallError]:       No package 'cairo' found
[pipenv.exceptions.InstallError]:       Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
[pipenv.exceptions.InstallError]:       [end of output]
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]:   note: This error originates from a subprocess, and is likely not a problem with pip.
[pipenv.exceptions.InstallError]: error: legacy-install-failure
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]: × Encountered error while trying to install package.
[pipenv.exceptions.InstallError]: ╰─> pycairo
[pipenv.exceptions.InstallError]:
[pipenv.exceptions.InstallError]: note: This is an issue with the package mentioned above, not pip.
[pipenv.exceptions.InstallError]: hint: See above for output from the failure.
ERROR: Couldn't install package: pycairo
 Package installation failed...
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 0
@txoof
Copy link
Owner

txoof commented Feb 14, 2022

Good snooping. I'll spin up a 64bit image tomorrow and see if I can track this back to a sensible resolution. I'm open to just detecting the OS version and working from that if we can't figure out what's going on.

@aaronr8684
Copy link
Collaborator Author

I mean it might just make sense to add some arch if statements to add the necessary files for running the 32-bit compiled version on a 64-bit OS.

Also, is the Pipfile generated automatically or manually? I searched through the repo and the only reference I found to cairo is in the comments of the crypto plugin, but it doesn't seem to actually be used anywhere. I haven't done an exhaustive search, but if it's not required, and causing issues, the simple solution might be to remove the dependency

@txoof
Copy link
Owner

txoof commented Feb 15, 2022

It's a hidden dependency of pygal in the crypto plugin. Took me forever to figure that out. The requirements.txt are generated programmatically.

The eventual goal is to have a plugin installer that uses the requirements. Then plugins can be installed on demand and live in their own repos rather than being baked in to paper pi.

@aaronr8684
Copy link
Collaborator Author

I wondered if it wasn't something like that. That makes sense.

A plugin installer would be slick. I'll keep an eye out for similar solutions.

@txoof txoof added this to the Reliable Installers milestone Feb 15, 2022
@txoof
Copy link
Owner

txoof commented Feb 15, 2022

I'm trying out the "milestones" feature in Github to to try to add some order to the project.

I have a lot of ideas about what I'd like this version to be able to do and I really need to document it out in some sensible way.

@aaronr8684
Copy link
Collaborator Author

Might also be a good chance to start using the projects tab on GitHub. I'm pretty sure it auto-imports issues and PRs and can be organized into goals (maybe even using the existing milestones) in a task tracking manner

@txoof
Copy link
Owner

txoof commented Feb 15, 2022

I looked at that this morning, but wasn't quite sure the purpose. I'll look again. Thanks for the tip.

@aaronr8684
Copy link
Collaborator Author

I think it could be used to track progress on an issue or PR. Like needs investigating, being worked on, waiting on something, etc.

Here's an example of it being used in full (probably overkill for this repo), but good to see how it could be used.
https://github.com/orgs/microsoft/projects/30

@txoof
Copy link
Owner

txoof commented Feb 15, 2022

@aaronr8684
I just learned a few interesting things:

  1. Our installer will blindly plow past errors with pipenv (not great, but manageable)
  2. And pycairo likely isn't needed at all (pretty great)

I was distracted and missed the error messages. I added the Crypto plugin and started it up and everything started as expected. This may solve one problem while presenting us with another in its place.

20220215_204141

Requirements file provided! Importing into Pipfile...
Installing dependencies from Pipfile...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 12/12 — 00:00:39
An error occurred while installing pycairo! Will try again.
Installing initially failed dependencies...
[pipenv.exceptions.InstallError]: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9dde2dc0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9dde2a90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9dde28e0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9dde2730>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9dde2580>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9e164160>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9e164730>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9dde02b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9dde2a00>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f9dde2880>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/pycairo/
[pipenv.exceptions.InstallError]: ERROR: Could not find a version that satisfies the requirement pycairo (from versions: none)
[pipenv.exceptions.InstallError]: ERROR: No matching distribution found for pycairo
ERROR: Couldn't install package: pycairo
 Package installation failed...
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 00:00:23
/home/pi/src/PaperPi
adding executable to /usr/local/bin//paperpi
adding user and group paperpi
installing system config
adding config file: /etc/default/paperpi.ini
installing systemd unit file to: /etc/systemd/system/paperpi-daemon.service
reloading systemd unit files
enabling systemd unit file
Created symlink /etc/systemd/system/multi-user.target.wants/paperpi-daemon.service → /etc/systemd/system/paperpi-daemon.service.

checking if SPI is enabled


SPI is not enabled, enabling now


    You must now complete the following steps
    REQUIRED:
    * edit /etc/default/paperpi.ini and set:
      - display_type = [YOUR_SCREEN]
# CONFIG_VERSION=1
[main]
# waveshare display type use HD for IT8951 displays
display_type = None
# required vcom value for IT8951 screens
vcom = 0.0
# maximum refresh between total screen clear for HD displays
max_refresh = 4
# logging output level
log_level = WARNING
# display splash screen (True or False)
splash = True
# rotation of EPD display
# (cable bottom: 0; cable left: -90; cable right: 90; cable top: 180)
      - vcom = [only set for HD screens]

@aaronr8684
Copy link
Collaborator Author

Yea I was playing around with that as well and it seems that import cairo in python still works even with the error during install.

But to your bigger point, we should handle errors somehow. I don't know the best way to do this. If the script will work anyway, we don't want to fail the whole install for a non-critical failure (especially for a single plugin).

@txoof
Copy link
Owner

txoof commented Feb 15, 2022

we don't want to fail the whole install for a non-critical failure (especially for a single plugin).

Good point. My shell-scripting-FU is pretty weak when it comes to this sort of thing. We might just want to see if we can detect errors and then alert the user that "some plugins might not work..." or something like that.

I've verified that removing pycairo solves this. CairoSVG==2.5.2 likely fulfills whatever SVG stuff pygal needs so we'll call it good.

@txoof txoof closed this as completed Feb 15, 2022
@aaronr8684
Copy link
Collaborator Author

Ok, I'll test a reinstall on my 64-bit as well.

@aaronr8684
Copy link
Collaborator Author

64-bit test was successful.

Also, for future reference, I did a uname -a on all my active Pi's. We can use this for future scripts that need to breakout which pi or os is running. Something like a uname -m will return the OS arch type which is useful for package installation.

  • Pi Z W running Raspbian Bullseye 32-bit

Linux raspberrypi 5.10.92+ #1514 Mon Jan 17 17:35:21 GMT 2022 armv6l GNU/Linux

  • Pi 4 running Raspbian Bullseye 32-bit

Linux raspberrypi 5.10.92-v7l+ #1514 SMP Mon Jan 17 17:38:03 GMT 2022 armv7l GNU/Linux

  • Pi 4 running Raspbian Bullseye 64-bit

Linux raspberrypi 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 GNU/Linux

  • Pi 3 running Raspbian Buster 32-bit

Linux rpi-pyserver 4.19.93-v7+ #1290 SMP Fri Jan 10 16:39:50 GMT 2020 armv7l GNU/Linux

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

2 participants