Skip to content

Commit e0a450f

Browse files
committed
fix? 👀
1 parent 8ae8ad4 commit e0a450f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cogs/plugins.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import importlib
22
import os
33
import shutil
4+
import site
45
import stat
56
import subprocess
7+
import sys
68

79
from colorama import Fore, Style
810
from discord.ext import commands
@@ -79,7 +81,6 @@ async def load_plugin(self, username, repo, plugin_name):
7981
dirname = f'plugins/{username}-{repo}/{plugin_name}'
8082
if 'requirements.txt' in os.listdir(dirname):
8183
# Install PIP requirements
82-
print(dirname + '/' + 'requirements.txt')
8384
try:
8485
await self.bot.loop.run_in_executor(
8586
None, self._asubprocess_run,
@@ -94,6 +95,11 @@ async def load_plugin(self, username, repo, plugin_name):
9495
raise DownloadError(
9596
f'Unable to download requirements: ```\n{error}\n```'
9697
) from exc
98+
else:
99+
if not os.path.exists(site.USER_SITE):
100+
os.makedirs(site.USER_SITE)
101+
102+
sys.path.insert(0, site.USER_SITE)
97103

98104
try:
99105
self.bot.load_extension(ext)

0 commit comments

Comments
 (0)