I set the PYTHONPATH
to '.'
and that solved it for me.
export PYTHONPATH='.'
For a one-liner you could as easily do:
PYTHONPATH='.' your_python_script
These commands are expected to be run in a terminal
More Related Contents:
- How do I unload (reload) a Python module?
- How to fix “Attempted relative import in non-package” even with __init__.py
- ImportError: Cannot import name X
- Import a file from a subdirectory?
- Reading file using relative path in python project
- Relative imports in Python 3
- Relative imports – ModuleNotFoundError: No module named x
- Does python optimize modules when they are imported multiple times?
- How to import a Python class that is in a directory above?
- PYTHONPATH vs. sys.path
- How to dynamically load a Python class
- Imports in __init__.py and ‘import as’ statement
- Why does Python’s __import__ require fromlist?
- Importing packages in Python
- Force python to use an older version of module (than what I have installed now)
- Absolute imports in python not working, relative imports work
- Local import statements in Python
- ‘ModuleNotFoundError’ when trying to import module from imported package
- How does one do the equivalent of “import * from module” with Python’s __import__ function?
- Good or bad practice in Python: import in the middle of a file [duplicate]
- How can I import a module dynamically given the full path?
- python using variables from another file
- Importing modules in Python – best practice
- How to solve import error for pandas?
- Python: is the current directory automatically included in path?
- Import paths – the right way?
- ImportError: libSM.so.6: cannot open shared object file: No such file or directory
- import matplotlib.pyplot hangs
- How to properly use relative or absolute imports in Python modules?
- How to reference python package when filename contains a period