TG bot (Python)
suntz1
HOBBYOP

2 years ago

Hello, how i can to depoy my TG bot ( Python ) ? I don't need to build anything, just run the script like this "python bot_ui.py".

7 Replies

2 years ago

Railway runs everything in containers, so an image does have to be built, there's no way around that.

What have you tried, what issues are you facing?


suntz1
HOBBYOP

2 years ago

I've successfully deployd, but, as i understand, i have to create pyproject.toml file and write here my modules and py version. Show me please how to write it. For example: i use "telebot" module and py version 3.11.4


2 years ago

That would unfortunately be out of scope as we can't offer coding help to that extent here.

I would highly recommend you go with a requirements.txt and runtime.txt files, there would be countless great resources on those online.


suntz1
HOBBYOP

2 years ago

Okay, thank you. I've created runtime.txt with dependencies and py version. Do I need to somehow define it in the deployment settings?


2 years ago

Dependencies are not defined in a runtime.txt, they are defined in a requirements.txt file, please watch some YouTube videos on this topic, and provided you did everything correctly all your dependencies will be install and the correct python version will be used.


suntz1
HOBBYOP

2 years ago

God, after so much time I came across a solution XD
In case it helps someone, here is a list of actions:
1) Generate a requirements.txt file
2) create a .python-version file, specify the desired version of Python in it

Changed:
3) In the deploy settings run your's main script. For example " main.py" :)
Good luck!


2 years ago

-3. please remove that, nixpacks will do that by default, meaning you are installing everything twice


Loading...