pyotherside
pyotherside copied to clipboard
Module Not Found
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
File "qrc:/qml/AdvancedOrthoElevationCreator/views//TiffWriter.py", line 3, in
ModuleNotFoundError: No module named 'osgeo' )
Sounds like a AdvancedOrthoElevationCreator issue and not a pyotherside issue. Have you installed osgeo?
dilloncsr @.***> schrieb am Do. 16. Feb. 2023 um 16:45:
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' )
— Reply to this email directly, view it on GitHub https://github.com/thp/pyotherside/issues/126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABBASN6GSP7NYY3XOXGOJTWXZDRBANCNFSM6AAAAAAU6K33OA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
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
If you have multiple versions of python3 installed, maybe the „regular python session“ is different from the libpython3 version against which pyotherside was linked? Also verify PYTHONPATH.
dilloncsr @.***> schrieb am Do. 16. Feb. 2023 um 16:51:
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
— Reply to this email directly, view it on GitHub https://github.com/thp/pyotherside/issues/126#issuecomment-1433305238, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABBASK4T4QHJBVSH5OEFGDWXZEGZANCNFSM6AAAAAAU6K33OA . You are receiving this because you commented.Message ID: @.***>
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.
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?
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.