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

ImportError: cannot import name 'unpackBook' from 'epy_extras' (unknown location) #71

Closed
3N4N opened this issue Nov 9, 2022 · 1 comment

Comments

@3N4N
Copy link
Contributor

3N4N commented Nov 9, 2022

$ cat ~/.local/bin/epy
#!/bin/env bash

python3 ~/projects/tools/epy/epy.py $*

$ epy ~/Documents/ebooks/Standalone/The_Fisherman.epub
Traceback (most recent call last):
  File "/home/enan/projects/tools/epy/epy.py", line 71, in <module>
    from epy_extras import unpackBook  # type: ignore
ImportError: cannot import name 'unpackBook' from 'epy_extras' (unknown location)

The culprit line is:

epy/epy.py

Lines 74 to 75 in f6965de

except ModuleNotFoundError:
MOBI_SUPPORT = False

I think it should work with ModuleNotFoundError, but for some reason the error that I am getting is ImportError.

As of now I'm simply adding ImportError to the except block:

except (ImportError, ModuleNotFoundError):
    MOBI_SUPPORT = False
@3N4N
Copy link
Contributor Author

3N4N commented Nov 9, 2022

For some reason, the folder epy_extras/ existed in my repository even though it wasn't in git ls-files nor in .gitignore. That folder existing is the reason for the error I was facing.

rm -rf epy_extras fixes it.

Feel free to close this. (But I am curious why this folder was left in the local repo when I pulled master branch.)

@3N4N 3N4N closed this as completed Jan 12, 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

1 participant