xgo-dev / xgo-dev/llgo

llgo run _pydemo got error by other way install python

Open
#344 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
LLVM
Stars
758
Forks
49
Avg merge
1d 6h
Merged PRs (30d)
138

Description

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) 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce llgo run . on macOS with a conda Python environment using LLGO_LIB_PYTHON, then inspect the llgo run path that invokes callpy and handles the missing libpython error. Done means users are prompted to set DYLD_LIBRARY_PATH when required, while the command succeeds when that variable is set.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, python
Domain
compilers, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.