requirements error

I have correctly mentioned the modules in my requirement.txt but they still arent getting installed ig ? cause it shows error :
Traceback (most recent call last):
File "main.py", line 3, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
Traceback (most recent call last):
File "main.py", line 3, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
29 Replies
Percy
Percy2y ago
Project ID: 5e2ab3e2-a923-4745-8998-3bbc19b57df5
asmod_deus
asmod_deusOP2y ago
5e2ab3e2-a923-4745-8998-3bbc19b57df5
asmod_deus
asmod_deusOP2y ago
rando
rando2y ago
does this happen locally or on Railway?
Brody
Brody2y ago
it's requirements.txt not requirement.txt
asmod_deus
asmod_deusOP2y ago
Fk. The build is success but the bot isnt online and no deploy logs
asmod_deus
asmod_deusOP2y ago
Brody
Brody2y ago
yeah known bug with the logging, team is working on migrating their logging solution, for now you can just redoploy (push a commit)
asmod_deus
asmod_deusOP2y ago
I did but the bot isnt even getting online earlier it was logging the errors
Brody
Brody2y ago
it's unfortunate, but just keep redeploying until you see logs you might have landed on a bad box
asmod_deus
asmod_deusOP2y ago
alr
asmod_deus
asmod_deusOP2y ago
I'm using aiosqlite as my db...is their any way to open it ? cause
asmod_deus
asmod_deusOP2y ago
I'm also trying the sql db that railway provides. Do i need to have CLI installed ? cause the db cant connect to my github project Also, how can i upload a font ?
Brody
Brody2y ago
1. use a db that railway provides 2. good, you're using a db that railway provides 2.1. yes, to fetch the database credentials that you've setup as variable references in your service, you will need the railway cli and the railway run command 3. depends, one thing at a time, get the db working first
asmod_deus
asmod_deusOP2y ago
Oh alr i simply put the stuff without vars. Ill do it. Is CLI compulsory ?
asmod_deus
asmod_deusOP2y ago
Am i suppose to fill it in or leave it like this ?
asmod_deus
asmod_deusOP2y ago
Pastebin
2023-05-05 11:48:45 INFO discord.client logging in using static...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
asmod_deus
asmod_deusOP2y ago
async def cog_load(self) -> None:
print("Leveling loaded")
setattr(self.bot, "db",
await aiomysql.connect(host=os.environ.get('MYSQLHOST'), user=os.environ.get("MYSQLUSER"), password=os.environ.get('MYSQLPASSWORD'),
db=os.environ.get('MYSQLDATABASE')))
print("DB connected in cog")
async def cog_load(self) -> None:
print("Leveling loaded")
setattr(self.bot, "db",
await aiomysql.connect(host=os.environ.get('MYSQLHOST'), user=os.environ.get("MYSQLUSER"), password=os.environ.get('MYSQLPASSWORD'),
db=os.environ.get('MYSQLDATABASE')))
print("DB connected in cog")
Connecting method
Brody
Brody2y ago
can you explain what you mean by this? it looks like you are missing the port variable in the connection code, make sure you setup all the variable references you would need
asmod_deus
asmod_deusOP2y ago
Like to run the DB is it compulsory to have CLI installed ?
Brody
Brody2y ago
if you want to run your code locally and have access to the service variables (so your code can connect to the railway database), then yes running your start command with railway run is the proper way to do it, that was the cli will pull the variables for you
asmod_deus
asmod_deusOP2y ago
Ok so i added port var and it still instead getting connected
Brody
Brody2y ago
show me the new code please?
asmod_deus
asmod_deusOP2y ago
Updated
async def cog_load(self) -> None:
print("Leveling loaded")
setattr(self.bot, "db",
await aiomysql.connect(host=os.environ.get('MYSQLHOST'), user=os.environ.get("MYSQLUSER"), password=os.environ.get('MYSQLPASSWORD'),
db=os.environ.get('MYSQLDATABASE'), port=os.environ.get("MYSQLPORT")))
print("DB connected in cog")
async def cog_load(self) -> None:
print("Leveling loaded")
setattr(self.bot, "db",
await aiomysql.connect(host=os.environ.get('MYSQLHOST'), user=os.environ.get("MYSQLUSER"), password=os.environ.get('MYSQLPASSWORD'),
db=os.environ.get('MYSQLDATABASE'), port=os.environ.get("MYSQLPORT")))
print("DB connected in cog")
Brody
Brody2y ago
and show me a screenshot of your service variables?
asmod_deus
asmod_deusOP2y ago
Brody
Brody2y ago
try this
async def cog_load(self) -> None:
print("Leveling loaded")
setattr(self.bot, "db",
await aiomysql.connect(host=os.environ['MYSQLHOST'], user=os.environ['MYSQLUSER'], password=os.environ['MYSQLPASSWORD'], db=os.environ['MYSQLDATABASE'], port=int(os.environ['MYSQLPORT'])))
print("DB connected in cog")
async def cog_load(self) -> None:
print("Leveling loaded")
setattr(self.bot, "db",
await aiomysql.connect(host=os.environ['MYSQLHOST'], user=os.environ['MYSQLUSER'], password=os.environ['MYSQLPASSWORD'], db=os.environ['MYSQLDATABASE'], port=int(os.environ['MYSQLPORT'])))
print("DB connected in cog")
asmod_deus
asmod_deusOP2y ago
yup this works thnx the DB is connected thnx for the help and time ✌️
Brody
Brody2y ago
no problem!
Want results from more Discord servers?
Add your server