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

2 years 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!

14 Replies

niemakestuff
HOBBYOP

2 years ago

N/A


niemakestuff
HOBBYOP

2 years ago

Btw, that error comes from the FIrestore library.


niemakestuff
HOBBYOP

2 years ago

1229100437643460600


niemakestuff
HOBBYOP

2 years ago

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


2 years ago

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


niemakestuff
HOBBYOP

2 years ago

I see
I have 0 experience with Docker

Is there a way to fix this without it?


2 years ago

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


niemakestuff
HOBBYOP

2 years ago

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


2 years ago

you mean flakes?


niemakestuff
HOBBYOP

2 years ago

yes


2 years 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


niemakestuff
HOBBYOP

2 years ago

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


niemakestuff
HOBBYOP

2 years ago

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


2 years ago

missing system library, yeah


Loading...