getting startet with railway
I have one question i am new to railway and just wantet to deploy my first project its a telegram bot written in python
But i get this error message in the railway logs
==============
Using Nixpacks
==============
Nixpacks build failed
Nixpacks was unable to generate a build plan for this app.
Please check the documentation for supported languages: https://nixpacks.com
The contents of the app directory are:
MoonAITGBotTestRailway.py
Does someone know what i did wrong and how to fix it
Getting Started | Nixpacks
App source + Nix packages + Docker = Image
67 Replies
Project ID:
N/A
Railway aims to provide the simplest way to develop, deploy, and diagnose issues with your application. To get started, you can create a project from a template, develop the project locally, and deploy to the cloud.
⚠️ experimental feature
I have not used github to deploy the code ive createt it as empty file over the terminal
Ive deletet the project id already but i can recreate the issue with a new project id if needed
Ive watched a video from neural nine on youtube and recreatet his steps which lead me to the error
That's not going to work, you'll want to start with a repository. Sounds like you're very new to web development, you'll want to start with a template repository.
This is a Python Django template
https://railway.app/new/template/GB6Eki
Alternatively, you can continue with the tutorial you're watching, but complete your app before hosting it. You should ensure your app works locally before hosting on Railway
I can provide the code if needed to its a basic version of the end product to get used to deployements
Yes i am completly new the code itself works flawlessly but i am not able to figure out how the deployments work i had already problems with other providers as netlify
Please send the code in a repository
Is there maybe a instruduction somewhere how i can get startet with railway for my python programms
Will upload it to github quick
GitHub
GitHub - 4207x/RailwayTestShow
Contribute to 4207x/RailwayTestShow development by creating an account on GitHub.
Ive removed all the error handlings and so on from the code as i did not know how the deployement will react to it and just wantet to get used to it before
Its just the bare minimum so that everything works without problems on the code side
First off, you should always be deploying from a Github repo it's the safest, most efficient way to code and deploy your code on any platform.
Second, you don't have a requirements.txt, main.py or runtime.txt like I mentioned before. Your build won't be recognized as a python build until you do.
What tutorial are you following? They can't have told you to host without creating the files you need
So i need to rename the bot python file to main.py and in the requirements i need to put in the libraries which i have needed or and what is the runtime.txt
runtime.txt should contain the python version you'll be using
This one
https://youtu.be/2YmdkXo7iP8
NeuralNine
YouTube
Railyway is The New Heroku
Today we learn about Railway, which is a platform that offers free hosting plans.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: https://www.neuralnine.com/books/
💻 The Algorithm Bible Book: https://www.neuralnine.com/books/
👕 Programming Merch: https://www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: ht...
Specifying a Python Runtime | Heroku Dev Center
Specifying a particular version of Python via your app's runtime.txt.
Skimmed through it and they're doing everything wrong. I suggest this tutorial. It goes very in depth in everything you need to know about django
Tech With Tim
YouTube
Django For Beginners - Full Tutorial
Welcome to this Django complete course. In this video, I'll be covering all the important aspects of Django that as a beginner you need to know. We'll cover setting up a simple Django application, creating a database, allowing users to sign up, sign in, and sign out, and even showing user specific pages.
💻 AlgoExpert is the coding interview pr...
Once you've made your app, come back here and I'll help you through the hosting process. Hosting on Railway is very simple
GitHub
GitHub - 4207x/newshow
Contribute to 4207x/newshow development by creating an account on GitHub.
Is that right so beside the api keys
I hate youtube some times its the best source sometimes its worth nothing
Thank you for the other video will take a look into
If that is right so what do i need to do next
Your repo is still the same as it was a couple hours ago
Have you followed the tutorial I sent?
Or are you going to stick with the tutorial you followed before
It can work, you'll just have to upload to Railway differently
I am currently still in a Call cant watch it currently need to watch it afterwards
When the tutorial which i have used is not working i will not use it github is so or so better over the long run
But i dont know now what parts of the tutorial i have watched are wrong and which are right
Do i only need to use the github repo link now as deployment as replacement to the empty file option
Yes
I'm not familiar with Telegram so I can't help you on that front, but if you deploy the repo you've created it may work
So i select github here and select the privat repo i made whuch is a direct copy of the last repo ive postet just with the api keys addet to it right
Yes
Found this tutorial for a telegram bot that seems decent
GeeksforGeeks
Create a Telegram Bot using Python - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
Ignore the video I sent above, I didn't realize you were making a telegram bot
the video is for a full python website
The telegram bot itself works flawlessly ive tested it exstensivly over the last two days its just the deployment which i am not familiar with until now
Got it, okay
That helps me to as i have build a Gui for the same AI Infrastructur to which needs to be deployed to
Let me try to select the new repo over railway
That looks good lets see
No the bot does not reply let me recheck and revoke the api keys quick maybe
Wait that is a code error not a deployment error railway cant see that the telegram.ext library is a part of the other library that should be a quick fix scnd
What does that error mean
It's saying that it can't find a distribution for telegram.ext
I don't think that's a package.
Can you go to your terminal, type pip freeze and take a screenshot?
You'll find all the packages you have installed there
Google's telling me that the correct package to install is
python-telegram-bot
, but let's make sure of that by looking at your pip freezeYeah thats the problem i meant before
Telegram.ext is not a normal package thats why i had it not in the requirements but without it the deployment crashed as it had no chance to find the telegram.ext library
Can you please send a screenshot of your pip freeze like I mentioned above
As seen in the logs from before
I can see that
That's not your pip freeze, this is how you can get that
Do you mean that
Or in the railway terminal
That's perfect
But telegram.ext xanr be in this list
Looks like you have a package called telegram installed. That package's latest version is pretty outdated
Are you sure your program runs fine on your local machine?
Yep
That's odd
It worked fine
Well, I Googled around and apparently this package is the one to use
It was last updated 5 days ago, much more recently than the one you're using
You can get some help with that package from the Telegram group that's linked on the PyPi page
Oooh that looks promosing let me try it out if i can replace telegram.ext with it i hope so as telegram.ext is rhe official telegram python library amd has basicly all functions lets see
It is not possible to use only the python-telegram-bot library to achieve everything that the bot in the provided code does. The python-telegram-bot library is a wrapper around the telegram.ext library, which means that it provides the same functionality as telegram.ext, but with a slightly different API. Therefore, if you want to use the python-telegram-bot library, you will still need to use the telegram.ext library in your code.
Let me ask the python community quick
the python-telegram-bot library says it comes with the telegram.ext library
One side says that the other side say that i will just make a test code and try it out🤣🤣
telegram.ext is a submodule in the code
It's included
They don't install all packages all the time, which seems odd to me. Looks like you'll want to put python-telegram-bot[ext] to get all the .ext features
I can localy test the code wirhout beeing in need to remoce the failed deployment or
Yes
The failed deployment doesn't cost you any money
The python community was able to help me i have used a old library i needed to replace telegram with python-telegram-bot
Telegram is not available anymore and got replaced by python-telegram-bot
Thank you for your help
no problem, I figured that was the case
I have one more question i have integratet a function in my bot which works as error handling and gets called after 30 seconds if the request fails for that i need the library time but as i have integratet time in the requirements file i became a error in the deploy is it not needed to put the library time in the requirements or am i doing something wrong
time is in base python, you don’t have to install it
you don’t need to put it in your requirements.txt
Thats i thought already thank you for the quick reply
I have actualy one more question how does it look like with updating the librarys do i need to do it or is that a railway part
if you specify versions in your requirements.txt then every deploy will always use the latest version of each package
however, this isn’t recommended as new versions may have slightly different syntax/behaviour from older versions which can cause issues in your code
best practice is to specify a version unless you absolutely need to have the latest version
Aah okay thank you