#Error Importing Plugin

1 messages · Page 1 of 1 (latest)

young cliff
#
Traceback (most recent call last):
  File "c:\Users\halfs\Desktop\Vasuki-Re-Write\Vasuki\index.py", line 80, in <module>
    bot.load_extensions_from("plugin/searchanime")
  File "C:\Users\halfs\AppData\Roaming\Python\Python39\site-packages\lightbulb\app.py", line 591, in load_extensions_from
    raise ValueError(f"'{path}' must be relative to the working directory") from None
ValueError: 'plugin\searchanime' must be relative to the working directory```

Getting this error.


```py
bot.load_extensions_from("plugin/searchanime")```
frigid python
#

Like it says, you removed the o so important ./

#

That tells it "in this folder, look for the plugin folder"

young cliff
# frigid python Like it says, you removed the o so important ./
Traceback (most recent call last):
  File "c:\Users\halfs\Desktop\Vasuki-Re-Write\Vasuki\index.py", line 80, in <module>
    bot.load_extensions_from("./plugin/searchanime")
  File "C:\Users\halfs\AppData\Roaming\Python\Python39\site-packages\lightbulb\app.py", line 591, in load_extensions_from
    raise ValueError(f"'{path}' must be relative to the working directory") from None
ValueError: 'plugin\searchanime' must be relative to the working directory```
frigid python
#

What's your cwd?

young cliff
#
bot.load_extensions_from("./plugin/searchanime")
quaint cedar
#

How are you running the bot?

young cliff
young cliff
quaint cedar
#

What's your python command?

young cliff
young cliff
#

C:\Users\halfs\Desktop\Vasuki-Re-Write\Vasuki>

#

yet again

#

the same error

quaint cedar
#

@young cliff what is in plugin/ ?

young cliff
#

another folder

#

which has

quaint cedar
#

Create an __init__.py in every one of the subfolders

young cliff
#

but why

#

catThink did init.py

#

did something

quaint cedar
#

It's to python can detect it as an importable path