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
Percy
Percy2y ago
Project ID: N/A
Percy
Percy2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
Please send the code in a repository
JustinMauriceM
JustinMauriceMOP2y ago
Is there maybe a instruduction somewhere how i can get startet with railway for my python programms Will upload it to github quick
JustinMauriceM
JustinMauriceMOP2y ago
GitHub
GitHub - 4207x/RailwayTestShow
Contribute to 4207x/RailwayTestShow development by creating an account on GitHub.
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
runtime.txt should contain the python version you'll be using
JustinMauriceM
JustinMauriceMOP2y ago
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...
Adam
Adam2y ago
Specifying a Python Runtime | Heroku Dev Center
Specifying a particular version of Python via your app's runtime.txt.
Adam
Adam2y ago
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
Adam
Adam2y ago
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...
Adam
Adam2y ago
Once you've made your app, come back here and I'll help you through the hosting process. Hosting on Railway is very simple
JustinMauriceM
JustinMauriceMOP2y ago
GitHub
GitHub - 4207x/newshow
Contribute to 4207x/newshow development by creating an account on GitHub.
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
Yes Found this tutorial for a telegram bot that seems decent
Adam
Adam2y ago
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.
Adam
Adam2y ago
Ignore the video I sent above, I didn't realize you were making a telegram bot the video is for a full python website
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
Got it, okay
JustinMauriceM
JustinMauriceMOP2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
That looks good lets see
JustinMauriceM
JustinMauriceMOP2y ago
No the bot does not reply let me recheck and revoke the api keys quick maybe
JustinMauriceM
JustinMauriceMOP2y ago
JustinMauriceM
JustinMauriceMOP2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
What does that error mean
JustinMauriceM
JustinMauriceMOP2y ago
Adam
Adam2y ago
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 freeze
JustinMauriceM
JustinMauriceMOP2y ago
Yeah 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
Adam
Adam2y ago
Can you please send a screenshot of your pip freeze like I mentioned above
JustinMauriceM
JustinMauriceMOP2y ago
As seen in the logs from before
Adam
Adam2y ago
I can see that That's not your pip freeze, this is how you can get that
JustinMauriceM
JustinMauriceMOP2y ago
Do you mean that
JustinMauriceM
JustinMauriceMOP2y ago
Or in the railway terminal
Adam
Adam2y ago
That's perfect
JustinMauriceM
JustinMauriceMOP2y ago
But telegram.ext xanr be in this list
Adam
Adam2y ago
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?
JustinMauriceM
JustinMauriceMOP2y ago
Yep
Adam
Adam2y ago
That's odd
JustinMauriceM
JustinMauriceMOP2y ago
It worked fine
Adam
Adam2y ago
Well, I Googled around and apparently this package is the one to use
Adam
Adam2y ago
PyPI
python-telegram-bot
We have made you a wrapper you can't refuse
Adam
Adam2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
the python-telegram-bot library says it comes with the telegram.ext library
JustinMauriceM
JustinMauriceMOP2y ago
One side says that the other side say that i will just make a test code and try it out🤣🤣
Adam
Adam2y ago
Adam
Adam2y ago
telegram.ext is a submodule in the code It's included
Adam
Adam2y ago
Adam
Adam2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
I can localy test the code wirhout beeing in need to remoce the failed deployment or
Adam
Adam2y ago
Yes The failed deployment doesn't cost you any money
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
no problem, I figured that was the case
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
time is in base python, you don’t have to install it you don’t need to put it in your requirements.txt
JustinMauriceM
JustinMauriceMOP2y ago
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
Adam
Adam2y ago
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
JustinMauriceM
JustinMauriceMOP2y ago
Aah okay thank you
Want results from more Discord servers?
Add your server