E: Unable to locate package python-is-python3

I want to deploy a new application, but when I use the command ‘fly deploy’, I get this message in the console.

I tried to install the indicated command but I couldn’t do it, I’m working on macOS, I also tried to run it by brew, example: brew install curl python pkg-config, but I still get the same error when running fly deploy.
Also comment out the line that executes that command in the dockerfile, and in this way I no longer get the error, but the deploy is not completed correctly because it did not go beyond this point:

I’m not sure if the problems are related, but what is certain is that I can’t deploy the application correctly
I would be very grateful for help! Thank you.

What does your Dockerfile look like? I had the same issue in my Nodejs project and I fixed it by setting a newer Nodejs version in the Dockerfile that Fly generates for you.

It looks like this:

syntax = docker/dockerfile:1

Adjust NODE_VERSION as desired

ARG NODE_VERSION=16.14.2

FROM node:${NODE_VERSION}-slim as base

LABEL fly_launch_runtime=“NodeJS”

NodeJS app lives here

WORKDIR /app

Set production environment

ENV NODE_ENV=production

Throw-away build stage to reduce size of final image

FROM base as build

Install packages needed to build node modules

RUN apt-get update -qq && \

apt-get install -y python-is-python3 pkg-config build-essential

Install node modules

COPY --link package.json .

RUN npm install --production=false

Copy application code

COPY --link . .

Remove development dependencies

RUN npm prune --production

Final stage for app image

FROM base

Copy built application

COPY --from=build /app /app

Start the server by default, this can be overwritten at runtime

CMD [ “npm”, “run”, “start” ]

It looks like for Node 16, the right answer is to change python-is-python3 to simply python. Another thing that will work for 16.14.2 is to change -slim to -buster-slim.

But for many applications, commenting this line out may be just fine. And it looks like your app may not need this, as you were able to successfully build.

To debug why your application did not successfully deploy, you will need to look at your log files. I generally find it best to run fly dashboard and then click on “monitoring” on the left, but you can also see your logs with fly logs.

Most commonly the problem is that the generated fly.toml will say internal_port = 8080, but your application may be starting on port 3000 instead. Changing fly.toml to match the port your application is running on and redeploying will get you up and running.

I’m working on improving fly.io’s support for node applications at the moment, and reports like these are very helpful.

Thanks for your answer, however i keep getting the same issue, here are the logs files.
2023-04-23T16:57:32.234 app[e784e22df50283] scl [info] Starting clean up.
2023-04-23T16:57:33.236 app[e784e22df50283] scl [info] [ 184.308256] reboot: Restarting system
2023-04-24T15:24:41.295 runner[e784e22df50283] scl [info] Pulling container image registry.fly.io/videogames-pi-pat:deployment-01GYSXV4NQDQFYBDW3HTTWNNTB
2023-04-24T15:24:43.923 runner[e784e22df50283] scl [info] Unpacking image
2023-04-24T15:24:44.492 runner[e784e22df50283] scl [info] Successfully prepared image registry.fly.io/videogames-pi-pat:deployment-01GYSXV4NQDQFYBDW3HTTWNNTB
2023-04-24T15:24:45.189 app[e784e22df50283] scl [info] Starting init (commit: 1578345)…
2023-04-24T15:24:45.201 app[e784e22df50283] scl [info] Preparing to run: docker-entrypoint.sh npm run start as root
2023-04-24T15:24:45.216 app[e784e22df50283] scl [info] 2023/04/24 15:24:45 listening on [fdaa:2:c7e:a7b:fb:6666:9328:2]:22 (DNS: [fdaa::3]:53)
2023-04-24T15:24:45.713 health[e784e22df50283] scl [warn] Health check on port 8080 is in a ‘warning’ state. Your app may not be responding properly.
2023-04-24T15:24:45.778 app[e784e22df50283] scl [info] > api@1.0.0 start
2023-04-24T15:24:45.778 app[e784e22df50283] scl [info] > node .
2023-04-24T15:24:47.426 app[e784e22df50283] scl [info] Listen on port undefined
2023-04-24T15:24:53.714 health[e784e22df50283] scl [error] Health check on port 8080 has failed. Your app is not responding properly.
2023-04-24T15:27:28.787 proxy [e784e22df50283] scl [info] Downscaling app videogames-pi-pat in region scl. Automatically stopping machine e784e22df50283. 1 instance is running but has no load
2023-04-24T15:27:28.789 app[e784e22df50283] scl [info] Sending signal SIGINT to main child process w/ PID 513
2023-04-24T15:27:33.819 app[e784e22df50283] scl [info] Sending signal SIGTERM to main child process w/ PID 513
2023-04-24T15:27:34.407 app[e784e22df50283] scl [info] Starting clean up.
2023-04-24T15:27:35.408 app[e784e22df50283] scl [info] [ 170.308043] reboot: Restarting system

I’d have to see your application to be sure, but it looks like your application has some code like:

const port = process.env.PORT
app.listen(port, () => {
})

And the PORT environment variable is undefined. if this is the case, you can modify your code to default to port 8080, or you can set the needed environment variable in either your Dockerfile or fly.toml.

That fixed it!, thanks a lot for the help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.