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

Module Not Found #126

Open
dilloncsr opened this issue Feb 16, 2023 · 6 comments
Open

Module Not Found #126

dilloncsr opened this issue Feb 16, 2023 · 6 comments

Comments

@dilloncsr
Copy link

When I import a python file I get the following error:

"PyOtherSide error: Traceback (most recent call last):\n\n File "qrc:/qml/AdvancedOrthoElevationCreator/views//TiffWriter.py", line 3, in \n from osgeo import gdal\n\nModuleNotFoundError: No module named 'osgeo'\n"
Unhandled PyOtherSide error: Cannot import module: TiffWriter (Traceback (most recent call last):

File "qrc:/qml/AdvancedOrthoElevationCreator/views//TiffWriter.py", line 3, in
from osgeo import gdal

ModuleNotFoundError: No module named 'osgeo'
)

@thp
Copy link
Owner

thp commented Feb 16, 2023 via email

@dilloncsr
Copy link
Author

yes, I can run the script from a regular python session and it is successful but if I place this same file in the application using pyotherside I get this error

@thp
Copy link
Owner

thp commented Feb 16, 2023 via email

@thp
Copy link
Owner

thp commented Feb 17, 2023

As described in the Building PyOtherSide documentation, you can pass in a custom PYTHON_CONFIG when running qmake to make sure PyOtherSide is built against the correct Python version on your system. For this version, you will also have to install any additional modules.

Note that in some extreme convoluted cases, python3.11-config (let's say) might actually be from a different installation than python3.11 (let's say). Without knowing your concrete setup, I can't really help you with this issue.

In any case, AdvancedOrthoElevationCreator doesn't seem to have its source available, so without additional information, I won't be able to help out with this issue, and it's not a PyOtherSide issue per se.

@dilloncsr
Copy link
Author

Thank you for the response! You have helped me significantly!!! It appears that, in fact, GDAL was not installed in the python version that I was using with Qt. I do have one other question though, how would I include the GDAL library in the project as I did with the Python standard Library?

@thp
Copy link
Owner

thp commented Feb 20, 2023

How did you include the standard library? If it's just a ZIP file, and GDAL is also a pure python library, just include it in the ZIP file. If not (e.g. it includes .pyd/.dll/... binaries), it might be a bit more tricky, depending on the target platform.

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