cjerzak / causalimages-software

causalimages: An R package for performing causal inference with image and image sequence data
https://arxiv.org/pdf/2310.00233
MIT License
16 stars 1 forks source link

Error when Following the Build Backend Tutorial #13

Open WarrenZhu050413 opened 2 months ago

WarrenZhu050413 commented 2 months ago

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:

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!

cjerzak commented 2 months ago

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()?

WarrenZhu050413 commented 2 months ago

+ /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]```
cjerzak commented 2 months ago

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.

WarrenZhu050413 commented 2 months ago

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>

cjerzak commented 2 months ago

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

WarrenZhu050413 commented 2 months ago

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>

cjerzak commented 2 months ago

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