I get an error when importing scikit-image into python under termux on Android:…
- User
I get an error when importing scikit-image into python under termux on Android: Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/skimage/init.py", line 122, in from ._shared import geometry ImportError: dlopen failed: cannot locate symbol "PyExc_ImportError" referenced by "/data/data/com.termux/files/usr/lib/python3.11/site-packages/skimage/_shared/geometry.cpython-311.so"...
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/storage/emulated/0/fuckingpython/2dto3d.py", line 3, in from skimage import measure File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/skimage/init.py", line 125, in _raise_build_error(e) File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/skimage/init.py", line 102, in _raise_build_error raise ImportError( ImportError: dlopen failed: cannot locate symbol "PyExc_ImportError" referenced by "/data/data/com.termux/files/usr/lib/python3.11/site-packages/skimage/_shared/geometry.cpython-311.so"... It seems that scikit-image has not been built correctly.
- Assistant
The error you are encountering suggests that there may be an issue with how scikit-image was built and installed in your environment. Here are a few steps you can try to resolve this issue:
-
Update termux and its packages to make sure you have the latest versions:
apt update apt upgrade -
Reinstall the scikit-image package:
pip uninstall scikit-image pip install scikit-image -
If reinstalling scikit-image doesn't solve the problem, you can try reinstalling numpy and scikit-learn as well:
pip uninstall numpy scikit-learn pip install numpy scikit-learn -
If the problem still persists, you can try using a different method to install scikit-image. Instead of using the
pippackage manager, you can try installing it using theaptpackage manager provided by termux:apt install python-skimageNote that this method may not always have the latest version of scikit-image available.
If none of these solutions work, you may want to consider seeking help from the termux community or the scikit-image project support channels to get a more specific resolution to this issue.
-