R
Railway16mo ago
ketpahty

How to install python3 on railway server for Node.js project

I'm running a python script in my node js API and it works locally but i don't think python3 is installed on my railway server and i'm getting errors, how do i fix this?
11 Replies
Percy
Percy16mo ago
Project ID: N/A
ketpahty
ketpahtyOP16mo ago
N/A
Brody
Brody16mo ago
add a nixpacks.toml file to your project with this
[phases.setup]
nixPkgs = ["...", "python3"]
[phases.setup]
nixPkgs = ["...", "python3"]
please keep your questions in #✋|help spamming other channels will result in a kick
ketpahty
ketpahtyOP16mo ago
my apologies that's all? does the ellipses need to be anything? appreciate your help do i install other pip packages here as well? getting an issue with an installed module
Brody
Brody16mo ago
do you need to install python packages?
ketpahty
ketpahtyOP16mo ago
yeah getting ModuleNotFoundError: No module named in my server logs
Brody
Brody16mo ago
okay I will circle back around to this thread later, in the mean time can you please provide me with your repo so that once I get back I'll be able to create a nixpacks.toml file for you
ketpahty
ketpahtyOP16mo ago
i'm just running a python script using the "spawn" command from "child_process" in my node controller and that python script imports the module "telethon"
from telethon.sync import TelegramClient
import sys
import json
import os
from telethon.sync import TelegramClient
import sys
import json
import os
for which on my local i ran "pip3 install telethon" the rest of the codebase is irrelevant, your suggestion got the python file running it is just missing this telethon module and i'm not sure how to install it (can i ssh into the railway server? or do i need to do something in this .toml file?)
Brody
Brody16mo ago
I'm sorry but userbots are not allowed on railway https://railway.app/legal/fair-use telethon counts as a userbot unfortunately
ketpahty
ketpahtyOP16mo ago
oh drats thanks for letting me know, ill find a different solution
Brody
Brody16mo ago
yeah sorry, and thank you for understanding
Want results from more Discord servers?
Add your server