causalimages-software icon indicating copy to clipboard operation
causalimages-software copied to clipboard

Error when Following the Build Backend Tutorial

Open WarrenZhu050413 opened this issue 1 year ago • 7 comments

Issue

I encountered an issue while trying to create a new conda environment using the causalimages::BuildBackend function. The process fails with the following error:

Error while loading conda entry point: conda-libmamba-solver (dlopen(/Users/wz/opt/anaconda3/lib/python3.9/site-packages/libmambapy/bindings.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libarchive.19.dylib
  Referenced from: <0A274167-3E38-3A79-BEF4-748CC0170E30> /Users/wz/opt/anaconda3/lib/libmamba.2.0.0.dylib
  Reason: tried: '/Users/wz/opt/anaconda3/lib/libarchive.19.dylib' (no such file), '/Users/wz/opt/anaconda3/lib/python3.9/site-packages/libmambapy/../../../libarchive.19.dylib' (no such file), '/Users/wz/opt/anaconda3/lib/python3.9/site-packages/libmambapy/../../../libarchive.19.dylib' (no such file), '/Users/wz/opt/anaconda3/bin/../lib/libarchive.19.dylib' (no such file), '/Users/wz/opt/anaconda3/bin/../lib/libarchive.19.dylib' (no such file), '/usr/local/lib/libarchive.19.dylib' (no such file), '/usr/lib/libarchive.19.dylib' (no such file, not in dyld cache))

CondaValueError: You have chosen a non-default solver backend (libmamba) but it was not recognized. Choose one of: classic

What I did

  1. I ran 'which conda' on my terminal which returned the file address '/Users/wz/opt/anaconda3/bin/conda'
  2. I then ran causalimages::BuildBackend function with the following command:
    causalimages::BuildBackend(conda = "/Users/wz/opt/anaconda3/bin/conda")
    
  3. This triggers the command:
    /Users/wz/opt/anaconda3/bin/conda create --yes --name CausalImagesEnv 'python=3.11' --quiet -c conda-forge
    
  4. The error is then displayed.

System Information:

  • macOS Sonoma 14.2.1
  • Anaconda version: 24.3.0

I'm not sure how to fix this error. Maybe it is some problem with how I am managing my Anaconda environment. Thanks for helping!

WarrenZhu050413 avatar Jun 22 '24 12:06 WarrenZhu050413

I will send you in a minute a script that manually re-creates the environment we can do further testing on. My best guess is that we might need to set some R environmental variables to tell R and/or conda where to find some LD libraries. What happens when you just try causalimages::BuildBackend()?

cjerzak avatar Jul 03 '24 00:07 cjerzak

+ /Users/wz/opt/anaconda3/bin/conda create --yes --name CausalImagesEnv 'python=3.11' --quiet -c conda-forge
Error while loading conda entry point: conda-libmamba-solver (dlopen(/Users/wz/opt/anaconda3/lib/python3.9/site-packages/libmambapy/bindings.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libarchive.19.dylib
  Referenced from: <0A274167-3E38-3A79-BEF4-748CC0170E30> /Users/wz/opt/anaconda3/lib/libmamba.2.0.0.dylib
  Reason: tried: '/Users/wz/opt/anaconda3/lib/libarchive.19.dylib' (no such file), '/Users/wz/opt/anaconda3/lib/python3.9/site-packages/libmambapy/../../../libarchive.19.dylib' (no such file), '/Users/wz/opt/anaconda3/lib/python3.9/site-packages/libmambapy/../../../libarchive.19.dylib' (no such file), '/Users/wz/opt/anaconda3/bin/../lib/libarchive.19.dylib' (no such file), '/Users/wz/opt/anaconda3/bin/../lib/libarchive.19.dylib' (no such file), '/usr/local/lib/libarchive.19.dylib' (no such file), '/usr/lib/libarchive.19.dylib' (no such file, not in dyld cache))

CondaValueError: You have chosen a non-default solver backend (libmamba) but it was not recognized. Choose one of: classic

Error: Error creating conda environment 'CausalImagesEnv' [exit code 1]```

WarrenZhu050413 avatar Jul 03 '24 03:07 WarrenZhu050413

What happens if you try to build a new environment using conda from the terminal? If that succeeds but the BuildBackend() call fails, the problem likely lies in the setting of environmental variables within R.

cjerzak avatar Jul 03 '24 12:07 cjerzak

I actually just tried it and it worked perfectly!

Sent via Superhuman ( @.*** )

On Wed, Jul 03, 2024 at 8:38 AM, Connor T. Jerzak < @.*** > wrote:

What happens if you try to build a new environment using conda from the terminal? If that succeeds but the BuildBackend() call fails, the problem likely lies in the setting of environmental variables within R.

— Reply to this email directly, view it on GitHub ( https://github.com/cjerzak/causalimages-software/issues/13#issuecomment-2205980478 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AY5JQRH24XLR43242OLCCQDZKPWF5AVCNFSM6AAAAABJXMT3SGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBVHE4DANBXHA ). You are receiving this because you authored the thread. Message ID: <cjerzak/causalimages-software/issues/13/2205980478 @ github. com>

WarrenZhu050413 avatar Jul 03 '24 12:07 WarrenZhu050413

Sounds good! Was this the BuildBackend() or Python way?

cjerzak avatar Jul 03 '24 12:07 cjerzak

Python way. Let me try with buildbackend

Sent via Superhuman iOS ( @.*** )

On Wed, Jul 3 2024 at 08:53, Connor T. Jerzak < @.*** > wrote:

Sounds good! Was this the BuildBackend() or Python way?

— Reply to this email directly, view it on GitHub ( https://github.com/cjerzak/causalimages-software/issues/13#issuecomment-2206008437 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AY5JQRDAPOWTFN3XWKXCHD3ZKPX3HAVCNFSM6AAAAABJXMT3SGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBWGAYDQNBTG4 ). You are receiving this because you authored the thread. Message ID: <cjerzak/causalimages-software/issues/13/2206008437 @ github. com>

WarrenZhu050413 avatar Jul 03 '24 13:07 WarrenZhu050413

Cool. If the BuildBackend way doesn't work that's an indication that we need to tweak the environmental variables R is using.

cjerzak avatar Jul 03 '24 13:07 cjerzak