0

I have a custom package that I am using for a python project that won't load for some reason. My structure is as follows:

ParentFolder
|-.gitignore
|-ReadMe.md
|-requirements.txt
|-setup.py
|-lib
  |-__init__.py
  |-NextBus.py
|-src
  |-Scheduler.py

the init function is empty and serves only to allow Python to view lib as a package directory. The import statement in Scheduler.py looks like this:

import lib.NextBus as nb

I tried another import statement that looked like this:

from lib.NextBus import *

which also issued the same error.

I am getting a pylint error that says "unable to import lib.NextBus", however in my IDE (VSCode) when I go to type the import statement it correctly autofills the statement, which makes me think that pylint knows that the package should be in lib. I wasn't able to uncover much more about my error as the NextBus code is custom written. Hopefully someone can help...?

  • This might not be the correct answer to your question. But VSCode always gave me import problems. Switched to pycharm community. – spattanaik75 Feb 27 '19 at 16:17
  • 1
    Possible duplicate of [Importing files from different folder](https://stackoverflow.com/questions/4383571/importing-files-from-different-folder) – Valentino Feb 27 '19 at 16:18
  • I tried running your code using VSCode 1.30.2 using python 3.6. Runs without error – spattanaik75 Feb 27 '19 at 16:18

0 Answers0