Packaging: There is a problem with CV2 of AppImages
- Dominant language
- C++
- Stars
- 33.6k
- Forks
- 6k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 196
Description
### Problem description
It looks like something is wrong with the setup of CV2 of AppImages.
The module is importing itself.
In the file:
```bash
squashfs-root/usr/lib/python3.11/site-packages/cv2/config.py
```
I fixed it this way:
```python
import os
# REMOVED
# BINARIES_PATHS = [
# os.path.join('/home/runner/work/FreeCAD/FreeCAD/package/rattler-build/.pixi/envs/default', 'lib')
# ] + BINARIES_PATHS
# ADDED
BINARIES_PATHS = BINARIES_PATHS
```
==============
Now, in the file:
```bash
squashfs-root/usr/lib/python3.11/site-packages/cv2/config-3.11.py
```
It was fixed this way:
```python
import os
# REMOVED
# PYTHON_EXTENSIONS_PATHS = [
# os.path.join('/home/runner/work/FreeCAD/FreeCAD/package/rattler-build/.pixi/envs/default/lib/python3.11/site-packages/cv2', 'python-3.11')
# ] + PYTHON_EXTENSIONS_PATHS
# ADDED
PYTHON_EXTENSIONS_PATHS = [
os.path.join(os.path.dirname(__file__), "python-3.11")
] + PYTHON_EXTENSIONS_PATHS
```
### Workbench affected?
Core (App, Gui,...)
### Steps to reproduce
This will print some shit on the terminal if it is problematic.
Otherwise, it will import silently.
```python
import cv2
```
And then you should be able to do this:
```python
cv2.__version__
```
### Expected behavior
Use cv2 after importing it.
### Actual behavior
I cannot use the cv2 module.
### Development version About Info (in Safe Mode)
```shell
OS: Ubuntu 26.04 LTS (ubuntu:GNOME/ubuntu/wayland)
Architecture: x86_64
Version: 1.2.0dev.20260526 (Git shallow)
Build date: 2026/05/26 17:25:08
Build type: Release
Branch: (HEAD detached at 26ca5b4bd)
Hash: 26ca5b4bda657d359a783e9de99d7ae0a07fc513
Python 3.11.14, Qt 6.8.3, Coin 4.0.3, Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, Clipper2 , IfcOpenShell 0.8.2, OCC 7.8.1
Locale: English/United States (en_US)
Stylesheet/Theme/QtStyle: OpenDark.qss/OpenDark/
Navigation Style/Orbit Style/Rotation Mode: Touchpad/Trackball/Drag at cursor
Logical DPI/Physical DPI/Pixel Ratio: 96/94.485/1
```
### Last known good version (optional)
```shell
```
Contributor guide
Assessment
This issue has not been assessed yet.