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

Python wrapper error: cannot import name 'Sioyek' from 'sioyek' #14

Open
maxigaz opened this issue May 28, 2023 · 2 comments
Open

Python wrapper error: cannot import name 'Sioyek' from 'sioyek' #14

maxigaz opened this issue May 28, 2023 · 2 comments

Comments

@maxigaz
Copy link

maxigaz commented May 28, 2023

I've recently installed the Python wrapper through pip install sioyek --user on Arch Linux.

When I run my Python script (either from the terminal or from Sioyek) that includes the line from sioyek import Sioyek, clean_path, I receive the following error:

Traceback (most recent call last):
  File "/home/maxigaz/.config/sioyek/scripts/search_and_jump.py", line 2, in <module>
    from sioyek import Sioyek, clean_path
ImportError: cannot import name 'Sioyek' from 'sioyek' (/home/maxigaz/.local/lib/python3.11/site-packages/sioyek/__init__.py)

I looked at the referenced __init__.py file, and it exists... although it is completely empty and has a size of 0B.

@ddxtanx
Copy link
Contributor

ddxtanx commented May 28, 2023

Because of the way this project is structured, if you want to import the Sioyek class, you'd want to import it like from [package].[file its defined in] import Sioyek. In this case it would then be from sioyek.sioyek import Sioyek.

@maxigaz
Copy link
Author

maxigaz commented May 29, 2023

from sioyek.sioyek import Sioyek works. Thank you!

I copied what I tried originally, from sioyek import Sioyek, clean_path, from the documentation.

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