0

Currently I have the following directoy structure (I'm on Windows running python 3.7.9).

-->backend
  functions.py
  -->crawlers
    -->forum1
      -->spiders
         spider1.py

I want to import the functions.py from the spider1.py but I'm unable to do so. So far I tried:

1. sys.path.append(0, "C:\\Users\\<my_user>\\backend\\")
2. sys.path.append(os.path.abspath('..\\backend'))

any ideas? I was used to javascript where the path is automatically read. With python I'm a bit lost and all solutions out there consider only one parent level. Thanks!

  • 1
    Does this answer your question? [Importing files from different folder](https://stackoverflow.com/questions/4383571/importing-files-from-different-folder) – Ori David Feb 10 '21 at 22:45
  • Is [this](https://stackoverflow.com/questions/4383571/importing-files-from-different-folder) post answer your question? – Ori David Feb 10 '21 at 22:45

0 Answers0