ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

nie0x6708HOBBY

a year ago

Something is being messed up in the C libraries and I don't know how to fix it.

Context: My Development Setup

Environment: Python 3.11 (Pipenv)
Operating System: NixOS

I also installed a Python package: google-cloud-firestore which depends on C libraries. Now, I don't really know how to install the C library(ies) required to use google-cloud-firestore, so I just use steam-run. It basically runs my program in an FHS environment so I don't have to go to the trouble of installing dependencies manually.

That works great.
I run my program with this command:

steam-run pipenv run ...

I can't run it with just:

pipenv run ...

Gives me this error:

ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory

Railway Side

On my Railway app, it works perfectly with:
Build: pipenv install
Start: pipenv run ...

The Problem

When I installed this Python library: https://pypi.org/project/libfaketime, the deployment broke.
It basically throws the same error as if I were not to use steam-run on my local machine.
I assume this library is not very compatible with nix filesystem.

Now I thought of using steam-run on Railway but I don't know how.

Would appreciate any help. Thanks in advance!

0 Replies

nie0x6708HOBBY

a year ago

N/A


nie0x6708HOBBY

a year ago

Btw, that error comes from the FIrestore library.


nie0x6708HOBBY

a year ago

1229100437643460600


nie0x6708HOBBY

a year ago

It was working fine before.
It only became like that when I installed libfaketime


a year ago

you would likely have a much easier time building your project with a Dockerfile instead of nixpacks


nie0x6708HOBBY

a year ago

I see
I have 0 experience with Docker

Is there a way to fix this without it?


a year ago

you would have to figure out all the nix packages your app will need to run and have nixpacks install them


nie0x6708HOBBY

a year ago

I know how to write nix configurations. Can I use it on Railway being its based on nix?


a year ago

you mean flakes?


nie0x6708HOBBY

a year ago

yes


a year ago

that would not yet be supported, but if you know how to do something that it would only take you a few minutes to get accustomed with a Dockerfile, a Dockerfile is essentially just a list of commands to setup and run your app


nie0x6708HOBBY

a year ago

I see. I'll try to learn it.
Thanks for the help!


nie0x6708HOBBY

a year ago

Anyways, may I know the reason why the error occurs? Is it just the library messing up the system?


a year ago

missing system library, yeah