How do I install packages?

aarushiswinneryo
TRIAL

7 months ago

I wanna install pymongo on my railway app but can't seem to find any way to do so….
Help please….

Solved

0 Replies

aarushiswinneryo
TRIAL

7 months ago

8d725b8a-af8f-42e0-9abd-dcb159922b38


7 months ago

for python you can reference dependencies and packages in a requirements.txt file


aarushiswinneryo
TRIAL

7 months ago

Just make a file like that and put in the root folder?πŸ˜Άβ€πŸŒ«οΈ


7 months ago

exactly


aarushiswinneryo
TRIAL

7 months ago

Alr, thanks ❀️


aarushiswinneryo
TRIAL

7 months ago

ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1


7 months ago

mind sending your full build logs using this tool?
https://bookmarklets.up.railway.app/log-downloader/


aarushiswinneryo
TRIAL

7 months ago

alright


aarushiswinneryo
TRIAL

7 months ago

Not working πŸ˜Άβ€πŸŒ«οΈ


7 months ago

🀨 the log downloader isn't working?


aarushiswinneryo
TRIAL

7 months ago

Like I'm doing as it says, but it's not doing anything πŸ˜Άβ€πŸŒ«οΈ


7 months ago

alright can you try just copy and pasting majority of the logs over here then, starting from the bottom (since that's likely where the error is at)


aarushiswinneryo
TRIAL

7 months ago

```#10 5.653 Successfully installed dnspython-2.7.0 pymongo-4.10.1

10 DONE 6.0s

11 [stage-0 7/11] COPY . /app/.

11 DONE 0.0s

12 [stage-0 8/11] RUN --mount=type=cache,id=s/6986dc47-590f-4eb2-b84c-138998ffdcbb-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt

12 0.142 Error: [Errno 26] Text file busy: '/opt/venv/bin/python'

12 ERROR: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1

[stage-0 8/11] RUN --mount=type=cache,id=s/6986dc47-590f-4eb2-b84c-138998ffdcbb-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt:

0.142 Error: [Errno 26] Text file busy: '/opt/venv/bin/python'

Dockerfile:28

26 | ENV NIXPACKSPATH=/opt/venv/bin:$NIXPACKSPATH

27 | COPY . /app/.

28 | >>> RUN --mount=type=cache,id=s/6986dc47-590f-4eb2-b84c-138998ffdcbb-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt

29 |

30 |

ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1

Error: Docker build failed```


aarushiswinneryo
TRIAL

7 months ago

```#7 [stage-0 3/11] COPY .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix

7 CACHED

8 [stage-0 4/11] RUN nix-env -if .nixpacks/nixpkgs-bf446f08bff6814b569265bef8374cfdd3d8f0e0.nix && nix-collect-garbage -d

8 CACHED

9 [stage-0 5/11] COPY . /app/.

9 DONE 0.0s

10 [stage-0 6/11] RUN --mount=type=cache,id=s/6986dc47-590f-4eb2-b84c-138998ffdcbb-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt

10 4.730 Collecting pymongo>=4.10.1 (from -r requirements.txt (line 1))

10 4.794 Downloading pymongo-4.10.1-cp311-cp311-manylinux217x8664.manylinux2014x8664.whl.metadata (22 kB)

10 4.845 Collecting dnspython<3.0.0,>=1.16.0 (from pymongo>=4.10.1->-r requirements.txt (line 1))

10 4.854 Downloading dnspython-2.7.0-py3-none-any.whl.metadata (5.8 kB)

10 4.878 Downloading pymongo-4.10.1-cp311-cp311-manylinux217x8664.manylinux2014x8664.whl (1.7 MB)

10 4.916 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 48.1 MB/s eta 0:00:00

10 4.925 Downloading dnspython-2.7.0-py3-none-any.whl (313 kB)

10 4.929 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 313.6/313.6 kB 232.6 MB/s eta 0:00:00

10 5.039 Installing collected packages: dnspython, pymongo```


aarushiswinneryo
TRIAL

7 months ago

```#0 building with "builder-7xb4" instance using docker-container driver

1 [internal] load build definition from Dockerfile

1 transferring dockerfile: 2.92kB done

1 DONE 0.0s

2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1731369831

2 DONE 0.1s

3 [stage-0 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1731369831@sha256:248c718af9f76e602170a3cdbf69658edf55c910023104e1f277e517b77977a0

3 resolve ghcr.io/railwayapp/nixpacks:ubuntu-1731369831@sha256:248c718af9f76e602170a3cdbf69658edf55c910023104e1f277e517b77977a0 done

3 DONE 0.0s

4 [internal] load .dockerignore

4 transferring context: 2B done

4 DONE 0.0s

5 [internal] load build context

5 transferring context: 9.27kB done

5 DONE 0.0s

6 [stage-0 2/10] WORKDIR /app/

6 CACHED

```


7 months ago

thanks that's fine


7 months ago

that's interesting


aarushiswinneryo
TRIAL

7 months ago

lol


7 months ago

do you have any custom commands set or custom configurations?


aarushiswinneryo
TRIAL

7 months ago

i just have the default githup repo with just a generated domain
and a mongoDB


7 months ago

mind sending me a link to what github repo you're refering to?


aarushiswinneryo
TRIAL

7 months ago


7 months ago

oh


7 months ago

coould you try sending me a screenshot or the text from the top of the build logs?
it should look something like this

1322558489121394700


aarushiswinneryo
TRIAL

7 months ago

1322560770248151000


7 months ago

yea I figured, you're running pip install twice for some reason


7 months ago

is there a nixpacks.toml or railway.toml or something like that in your repo?


aarushiswinneryo
TRIAL

7 months ago

Nope


aarushiswinneryo
TRIAL

7 months ago

Oh wait, is it because I have two "python"s in my providers….?


aarushiswinneryo
TRIAL

7 months ago

Yep, that was it πŸ˜Άβ€πŸŒ«οΈ


7 months ago

ohh that'll do


7 months ago

so it's all working now?


aarushiswinneryo
TRIAL

7 months ago

Yep


aarushiswinneryo
TRIAL

7 months ago

Thanks


aarushiswinneryo
TRIAL

7 months ago

No more questions now lol, you can close this thread


7 months ago

Fantastic


7 months ago

happy I could help, have an awesome day!


7 months ago

!s


Status changed to Solved dev β€’ 7 months ago