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

Cannot Import Custom Module #514

Open
aghasemi opened this issue Jan 11, 2024 · 2 comments
Open

Cannot Import Custom Module #514

aghasemi opened this issue Jan 11, 2024 · 2 comments

Comments

@aghasemi
Copy link

Describe the problem
Hello,
Is there a special method for importing custom modules (i.e. Python files in the same directory) vs. ordinary, installed modules? I get "NoModuleFoundError" despite haveing the Python file in the same directory and making sure that both Java and Python are in the right "current directory".

Many thanks
Best

Environment (please complete the following information):

  • OS Platform, Distribution, and Version: Ubuntu 22.04
  • Python Distribution and Version: 3.10.12
  • Java Distribution and Version: 21
  • Jep Version: 4.2.0
  • Python packages used (e.g. numpy, pandas, tensorflow): none
@bsteffensmeier
Copy link
Member

When embedding python the current working directory is not automatically added to the path. You can add the cwd to the path by adding "." to JepConfig.addIncludePath, or the PYTHONPATH env var or adding it to sys.path in the Interpreter.

@aghasemi
Copy link
Author

Worked. Many thanks.

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