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

addImportPath with qrc paths broken #123

Open
wasular opened this issue Nov 16, 2021 · 2 comments
Open

addImportPath with qrc paths broken #123

wasular opened this issue Nov 16, 2021 · 2 comments

Comments

@wasular
Copy link

wasular commented Nov 16, 2021

I am currently trying to run pyotherside in a project on MacOs Monteray and QT 5.15.2 but I can't quite get this specific issue solved ... anyone here an idea ... On Windows and Linux it runs like a charm

Python Version via pyenv 3.9.6

Got library name:  "/opt/homebrew/Cellar/qt@5/5.15.2_1/qml/io/thp/pyotherside/libpyothersideplugin.dylib"
qml: Added Handler
"PyOtherSide error: Traceback (most recent call last):

  File \"<frozen importlib._bootstrap>\", line 919, in _find_spec
AttributeError: 'PyOtherSideQtRCImporter' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

ImportError: PyCapsule_Import could not import module \"datetime\"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File \"<frozen importlib._bootstrap>\", line 1007, in _find_and_load
  File \"<frozen importlib._bootstrap>\", line 982, in _find_and_load_unlocked
  File \"<frozen importlib._bootstrap>\", line 921, in _find_spec
  File \"<frozen importlib._bootstrap>\", line 895, in _find_spec_legacy
  File \"qrc://io/thp/pyotherside/qrc_importer.py\", line 26, in find_module
  File \"qrc://io/thp/pyotherside/qrc_importer.py\", line 38, in get_filename
SystemError: <built-in function qrc_is_file> returned a result with an error set

Unhandled PyOtherSide error: Cannot import module: bridge (Traceback (most recent call last):

  File "<frozen importlib._bootstrap>", line 919, in _find_spec

AttributeError: 'PyOtherSideQtRCImporter' object has no attribute 'find_spec'`
@wasular wasular closed this as completed Nov 17, 2021
@wasular wasular reopened this Nov 17, 2021
@wasular
Copy link
Author

wasular commented Nov 17, 2021

The issue seems to be clearly around putting a qrc path into addImportPath , trying to figure out how to circumvent this but since general python libs seem to work it is probably not directly related to the ARM processor architecture

@thp
Copy link
Owner

thp commented Feb 20, 2023

Looks like _find_spec / find_spec has been added in Python 3.4?

https://docs.python.org/3/library/importlib.html#importlib.abc.MetaPathFinder.find_spec

Are you sure you have the right bundled/frozen importlib/standard library?

@thp thp changed the title Issues building on Mac Os ARM addImportPath with qrc paths broken Feb 20, 2023
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