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

Running from source in Ubuntu 24.04 - wxPython import error #1476

Open
mahtDFR opened this issue Dec 28, 2024 · 2 comments
Open

Running from source in Ubuntu 24.04 - wxPython import error #1476

mahtDFR opened this issue Dec 28, 2024 · 2 comments

Comments

@mahtDFR
Copy link

mahtDFR commented Dec 28, 2024

Overview

This details the troubleshooting process for setting up Pronterface (part of Printrun) on Ubuntu 24.04 (Noble). The primary issue was missing dependencies and wxPython import errors, particularly related to libtiff.so.5. Hopefully this can help someone else facing similar issues.


Problem Summary

  • System: Ubuntu 24.04 (Noble)
  • Python Version: 3.9
  • Virtual Environment: Python 3.9 virtual environment (venv39)
  • Issue: Pronterface failed to run due to missing wxPython and system dependencies.

Error Messages

  1. wxPython Import Error:
wxPython >= 4 is not installed. This program requires wxPython >=4 to run.
  1. Missing libtiff.so.5:
ImportError: libtiff.so.5: cannot open shared object file: No such file or directory

Troubleshooting Process

Step 1: Install wxPython

pip install wxpython

Result:

Requirement already satisfied: wxPython==4.2.1

Despite the successful installation, Pronterface continued to report that wxPython was not installed.


Step 2: Check wxPython Import Directly

python -c "import wx; print(wx.__version__)"

Error:

ImportError: libtiff.so.5: cannot open shared object file: No such file or directory

Step 3: Identify Missing Dependencies

ldconfig -p | grep libtiff

Output:

libtiff.so.6 (libc6,x86-64) => /lib/x86_64-linux-gnu/libtiff.so.6

Problem: libtiff.so.5 was required, but libtiff.so.6 was installed.


Step 4: Create Compatibility Symlink

sudo ln -s /lib/x86_64-linux-gnu/libtiff.so.6 /lib/x86_64-linux-gnu/libtiff.so.5
sudo ldconfig

Step 5: Verify Symlink

ls -l /lib/x86_64-linux-gnu/libtiff.so.5

Output:

libtiff.so.5 -> /lib/x86_64-linux-gnu/libtiff.so.6

Step 6: Test wxPython Import

python -c "import wx; print(wx.__version__)"

Result:

4.2.1

Step 7: Run Pronterface

python pronterface.py

Success: Pronterface launched successfully.


Conclusion

The root cause was a missing libtiff.so.5 dependency. Creating a symlink to the available libtiff.so.6 resolved the issue. This workaround should function until official libtiff5 packages are made available for Ubuntu 24.04.


Notes

  • Ensure all necessary dependencies are installed:
sudo apt install libtiff-dev libsdl2-2.0-0 libjpeg-turbo8 libpng16-16
  • If new errors arise, rerun:
ldconfig -p | grep <missing-library>
  • Create symlinks carefully to avoid compatibility issues.
@rockstorm101
Copy link
Collaborator

rockstorm101 commented Dec 28, 2024

Hi @mahtDFR thanks for such a detailed report. Step 2 shows clearly that the issue belongs to wxPython and not to Printrun strictly speaking. Nonetheless, could you please confirm whether the issue occurs with latest wxPython 4.2.2? Many thanks in advance.

EDIT: The reported issue was reproduced by the test suit and happens for Python versions 3.8 to 3.11.

@rockstorm101
Copy link
Collaborator

could you please confirm whether the issue occurs with latest wxPython 4.2.2?

The answer is yes (as tested at [1]). Therefore Ubuntu 24.04 (and probably its upstream/downstream distros too) requires wxPython 4.2.2. I'll flag this issue as "Linux-only" because so far the wxPython 4.2.1 has worked fine everywhere else.

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

No branches or pull requests

2 participants