#Deploy python package (using poetry)
52 messages · Page 1 of 1 (latest)
Project ID: 66db9613-0a35-482d-be9e-217c9a0b1a17
When you deploy, the Railway container will look for requirements.txt, pyproject.toml and/or poetry.lock files in the root directory. It should automatically detect and install any dependancies.
66db9613-0a35-482d-be9e-217c9a0b1a17
Please post your repo and full logs
It's seems to be poetry issue, there is a way to debug the env maybe?
Or reproduce it? I'm running locally: poetry install, then poetry run... (my command), and it's just work
No, it doesn’t look like a poetry issue
If I disable the venv it's almost works (detect the package)
it looks like you’re trying to import maccabipediabot which is the sole folder inside of src
Yea, it's the package that I install as part of poetry install
It seems that the installation process isn't using the venv of poetry but a general python
I know next to nothing about poetry, but to me it looks like you should get rid of your src folder and move maccabipediabot up a level
or instead of importing maccabipediabot, import src.maccabipediabot
That works locally, that something with the remote setup, do you know if I can debug the remote env?
if I disable the virtualenv creation I get to pass this failed import
looks like you dont have a requirments.txt
no, that’s not the issue
I have pyproject.toml (that include the requiremnts)
maccabipediabot is not a package they’re importing, it’s part of their code
gotcha
That the package itself yea
I’m not sure what you mean by debug the environment
By debug I mean connect to the shell that will allow me to execute commands on the failed env
something is wrong with the python setup over there
If I'll change the start command to be sleep? I would be able to access it?
if your deployment is live you’re able to access a shell-like through the railway cli
I'm not sure if you are able to see the deploy logs (I connected the app to here), but if you don't I have this log line: #11 27.30 Installing the current project: maccabipediabot (0.14.4)
Which means that the package itself is being installed
But I think that everything is being created is a venv which is not poetry, can I override the installation command somehow?
I’m not part of the team so I’m not able to directly access your project
It should be just "poetry install"
Yes, you can create a nixpacks.toml to set all the parameters you should need
App source + Nix packages + Docker = Image
or create a dockerfile
I still see the old install command: #14 [stage-0 10/11] RUN --mount=type=cache,id=s/5eed4029-c51e-4192-8653-1a37570e9201-/root/cache/pip,target=/root/.cache/pip python -m venv /opt/venv && . /opt/venv/bin/activate && pip install poetry==1.3.1 && poetry install --no-dev --no-interaction --no-ansi
And yes it seems like it's opening a special venv (which is not needed)
Again, I’m really not familiar at all with poetry so I don’t know what environments are supposed to be opening or not
if you remove poetry from your project it should work fine, as that seems to be the problem
or do what I said above and shift maccabipediabot up a folder
I did it and got:
import _tkinter # If this fails your Python may not be configured for Tk
What will be the best approach to debug it? or to reproduce it locally
does tkinter require any external programs/packages to be installed? Either it’s not being pip installed correctly or you’re missing a requirement
if you’re missing a requirement, chances are there’s a nixpack for it. Add it to the setup section of your nixpacks.toml
you can search packages here
That a builtin module
Then it’s time to stackoverflow the error