Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llgo run _pydemo got error by other way install python #344

Open
luoliwoshang opened this issue Jun 17, 2024 · 2 comments
Open

llgo run _pydemo got error by other way install python #344

luoliwoshang opened this issue Jun 17, 2024 · 2 comments

Comments

@luoliwoshang
Copy link
Contributor

luoliwoshang commented Jun 17, 2024

We need to prompt the user to set DYLD_LIBRARY_PATH


I configured the python environment through conda, and I have set the LLGO_LIB_PYTHON

❯ echo $LLGO_LIB_PYTHON      
/opt/anaconda3/envs/python312env/lib/python3.12
(python312env) 
❯ llgo run .
dyld[64794]: Library not loaded: @rpath/libpython3.12.dylib
  Referenced from: <3A4ABF35-C399-30BF-A363-274C7529E109> /Users/zhangzhiyang/go/bin/callpy
  Reason: tried: '/libpython3.12.dylib' (no such file)

When 'DYLD_LIBRARY_PATH' is set, it will run normally

export DYLD_LIBRARY_PATH=/opt/anaconda3/envs/python312env/lib:$DYLD_LIBRARY_PATH

Environment

mac version: MacOS 14.2 M3 MacBook Pro (2023)

uname -a
Darwin ... 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:55 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8122 arm64
clang -v 
Homebrew clang version 17.0.6
Target: arm64-apple-darwin23.2.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm@17/bin
go version      
go version go1.20.14 darwin/arm64

python version

❯ which python                           
/opt/anaconda3/envs/python312env/bin/python

❯ python --version
Python 3.12.3
(python312env) 
@aofei
Copy link
Member

aofei commented Jun 19, 2024

I configured the python environment through conda, and I have set the LLGO_LIB_PYTHON

❯ echo $LLGO_LIB_PYTHON      
/opt/anaconda3/envs/python312env/lib/python3.12
(python312env) 
❯ llgo run .
dyld[64794]: Library not loaded: @rpath/libpython3.12.dylib
  Referenced from: <3A4ABF35-C399-30BF-A363-274C7529E109> /Users/zhangzhiyang/go/bin/callpy
  Reason: tried: '/libpython3.12.dylib' (no such file)

What happens if you set LLGO_LIB_PYTHON to -L/opt/anaconda3/envs/python312env/lib -lpython3.12?

@luoliwoshang
Copy link
Contributor Author

luoliwoshang commented Jun 19, 2024

I configured the python environment through conda, and I have set the LLGO_LIB_PYTHON我通过 conda 配置了 python 环境,并且设置了 LLGO_LIB_PYTHON

❯ echo $LLGO_LIB_PYTHON      
/opt/anaconda3/envs/python312env/lib/python3.12
(python312env) 
❯ llgo run .
dyld[64794]: Library not loaded: @rpath/libpython3.12.dylib
  Referenced from: <3A4ABF35-C399-30BF-A363-274C7529E109> /Users/zhangzhiyang/go/bin/callpy
  Reason: tried: '/libpython3.12.dylib' (no such file)

What happens if you set LLGO_LIB_PYTHON to -L/opt/anaconda3/envs/python312env/lib -lpython3.12?如果设置为 LLGO_LIB_PYTHON -L/opt/anaconda3/envs/python312env/lib -lpython3.12

It's still the same.

echo $LLGO_LIB_PYTHON                                                       
-L/opt/anaconda3/envs/python312env/lib -lpython3.12
(base) 
llgo/_pydemo/callpy on  main [$?] via 🐹 v1.20.13 
❯ llgo run .                                                                  
dyld[35298]: Library not loaded: @rpath/libpython3.12.dylib
  Referenced from: <CC44AA19-ED3D-33F8-816A-EB8B12E903AF> /Users/zhangzhiyang/go/bin/callpy
  Reason: tried: '/libpython3.12.dylib' (no such file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants