0

I have default directory in PyCharm named "Libraries" this is where all my python files are located. When I import files using the following it does not work.

from Libraries.my_python_file import my_function

But when I use file name without "Libraries." prefix it works

from my_python_file import my_function

Can anyone help me understand what it is that I am doing wrong?

I have the environment variable path set to the following

  • C:\Users\username\AppData\Local\Programs\Python\Python38\
  • C:\Users\username\AppData\Local\Programs\Python\Python38\Scripts\

1 Answers1

0

Try adding empty file __init__.py in Libraries directory.

Victor Ermakov
  • 471
  • 3
  • 6