I use VS code with PyLint for my python coding. My main coding language is Matlab but want to transition to Python for doing my scientific computing. This is my first attempt. I have the following project structure on disk which was inherited from the way I organized my Matlab code: my_project/ └── src/ ├── analysis_pkg/ │ ├── __init__.py │ ├── utils.py # defines load_velocity_data(), interpolate_nan() │ └── dissipation.py # defines dissipation_gerbi() └── scripts/ └── process_all.py In process_all.py I’m trying to import: # import other packages from analysis_pkg.utils import load_velocity_data, interpolate_nan from analysis_pkg.dissipation import dissipation_gerbi def main(): # Here I use load_velocity_data, interpolate_nan, dissipation_gerbi to analyze and plot my data if __name__ == "__main__": main() I get PyLint errors: Unable to import 'analysis_pkg.utils'(PylintE0401:import-error) Unable to import 'analysis_pkg.dissipation'Pylint(E0401:import-error) and can only run process_all.py by executing python -m scripts.process_all when I'm in the 'scripts' directory. My questions are: Why am I getting this error? My guess is that it comes from the fact the process_all.py is not in the same directory as analysis_pkg but I don't know how to fix the error Is this the most efficient (or elegant) way of structuring a project where you have to analyze data? What is the right way to import packages and the functions inside from different directories and how to run process_all.py in all these scenarios? Is 'python -m scripts.process_all' an optimal way to execute the main script? Thanks Continue reading...