I found this question helpful, but Python is unable still to find the folder.
I have a Django folder structure that looks like this:
- todoproject
- pythonDiscordChatbot
- processLessons.py
- todoapp
- testChatFunctions.py
- pythonDiscordChatbot
I'm trying to import a function called 'routes' into testChatFunctions.py, but I keep getting this error:
File "c:\Users\Kaij\Documents\chatSiteDjango\todoproject\todoapp\testChatFunctions.py", line 6, in <module>tSiteDjango\todoproject\todoapp\tesssLesson import *tChatFunctions.py", line 6, in <modd 'pythonDiscordChatbot'ule> atSiteDjango> & C:/Users/Kaij/Documents/djangoTests/django_tailwind_project/env/Scripts/ from pythonDiscordChatbot.procechatSiteDjango/todoproject/todoapp/testChatFunctions.pyssLesson import * ModuleNotFoundError: No module nametSiteDjango\todoproject\todoapp\testChatFunctions.py", line 6, in <module>d 'pythonDiscordChatbot Here's what I have tried:
# Bring your packages onto the path import sys, os sys.path.append(os.path.abspath(os.path.join('..', 'pythonDiscordChatbot'))) # Now do your import from pythonDiscordChatbot.processLesson import * # from pythonDiscordChatbot.processLesson import routes routes("hello", "website_180.02.1")
__init__.pyfile in thepythonDiscordChatbotfolder?