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

notebook.py causes ModuleNotFoundError when using PyCharm #1294

Open
SuomiKP31 opened this issue Feb 18, 2024 · 0 comments
Open

notebook.py causes ModuleNotFoundError when using PyCharm #1294

SuomiKP31 opened this issue Feb 18, 2024 · 0 comments

Comments

@SuomiKP31
Copy link

Running logic.ipynb in JetBrains PyCharm will execute this script (Located in "<venv/Scripts/jupyter-notebook-script.py>") to start the Jupyter server. The python version is 3.10, both venv & conda were tested.

import re
import sys

from notebook.app import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

A ModuleNotFoundError will be raised here since there's a file named "notebook.py" within the root folder of AIMA.
The script will report that "notebook" is not a module thus it cannot do "from notebook.app import main".
Renaming this file to "notebook_AIMA" fixed the problem.

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