I need to install libmagic in my railway project to run python magic
mushfikurahmaan
FREEOP

8 months ago

Could you help me install libmagic in my Railway project?
Below is my current nixpacks.toml configuration:

toml

CopyEdit

[phases.setup] nixPkgs = ["nodejs", "file", "zlib"] [phases.install] dependsOn = ["setup"]

Solved$10 Bounty

Pinned Solution

own171
HOBBY

8 months ago

Hey! I can help with that. You need to add libmagic to your nixpacks config.

Just update your nixpacks.toml file like this:

toml
[phases.setup] 
nixPkgs = ["nodejs", "file", "zlib", "libmagic"]

[phases.install] 
dependsOn = ["setup"]

Basically just add "libmagic" to your existing nixPkgs array in the setup phase. That should give your python magic module access to the libmagic library it needs.

After you update the file, redeploy on Railway and it should work.

2 Replies

own171
HOBBY

8 months ago

Hey! I can help with that. You need to add libmagic to your nixpacks config.

Just update your nixpacks.toml file like this:

toml
[phases.setup] 
nixPkgs = ["nodejs", "file", "zlib", "libmagic"]

[phases.install] 
dependsOn = ["setup"]

Basically just add "libmagic" to your existing nixPkgs array in the setup phase. That should give your python magic module access to the libmagic library it needs.

After you update the file, redeploy on Railway and it should work.


sim
FREE

8 months ago

What @own171 answered is correct

They have good documentation on Nixpacks python here: https://nixpacks.com/docs/providers/python


Status changed to Solved jake 8 months ago


Loading...