conda-forge / conda-forge/python-feedstock
libpython shared library cannot be found by python3-config on Mac
- Dominant language
- Shell
- Stars
- 47
- Forks
- 112
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 18
Description
`python3-config --ldflag` reports `-L/opt/miniconda3/lib/python3.12/config-3.12-darwin -ldl -framework CoreFoundation` on Mac. However, libpython is not included in -L, so linking to the conda python shared library is impossible.
For reference, the brew installed python creates a symlink to libpython in the library returned by python3-config.
```
$ python3.13-config --ldflags
-L/opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/lib/python3.13/config-3.13-darwin -ldl -framework CoreFoundation
$ ls -lhg /opt/homebrew/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/lib/python3.13/config-3.13-darwin
total 552
-rw-r--r--@ 1 admin 3.5K Feb 4 2025 config.c
-rw-r--r--@ 1 admin 1.7K Feb 4 2025 config.c.in
-rwxr-xr-x@ 1 admin 15K Feb 4 2025 install-sh
lrwxr-xr-x@ 1 admin 15B Feb 4 2025 libpython3.13.a -> ../../../Python
lrwxr-xr-x@ 1 admin 15B Feb 4 2025 libpython3.13.dylib -> ../../../Python
-rw-r--r--@ 1 admin 201K Feb 17 2025 Makefile
-rwxr-xr-x@ 1 admin 8.8K Feb 4 2025 makesetup
-rwxr-xr-x@ 1 admin 2.1K Feb 17 2025 python-config.py
-rw-r--r--@ 1 admin 3.8K Feb 4 2025 python.o
-rw-r--r--@ 1 admin 11K Feb 4 2025 Setup
-rw-r--r--@ 1 admin 954B Feb 4 2025 Setup.bootstrap
-rw-r--r--@ 1 admin 41B Feb 4 2025 Setup.local
-rw-r--r--@ 1 admin 6.6K Feb 4 2025 Setup.stdlib
```
### Conda Info
```shell
active environment : base
active env location : /opt/miniconda3
shell level : 1
user config file : /Users/batty/.condarc
populated config files : /opt/miniconda3/.condarc
/Users/batty/.condarc
conda version : 24.9.2
conda-build version : not installed
python version : 3.12.7.final.0
solver : classic
virtual packages : __archspec=1=m1
__conda=24.9.2=0
__osx=15.7.7=0
__unix=0=0
base environment : /opt/miniconda3 (writable)
conda av data dir : /opt/miniconda3/etc/conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/osx-arm64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/osx-arm64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /opt/miniconda3/pkgs
/Users/batty/.conda/pkgs
envs directories : /opt/miniconda3/envs
/Users/batty/.conda/envs
platform : osx-arm64
user-agent : conda/24.9.2 requests/2.32.3 CPython/3.12.7 Darwin/24.6.0 OSX/15.7.7 aau/0.4.4 c/. s/. e/.
UID:GID : 501:20
netrc file : None
offline mode : False
```
Note: reposting [https://github.com/conda/conda/issues/16177#issuecomment-4649074170](url)
Contributor guide
Research direction
Start by reproducing the reported macOS conda behavior with python3-config and inspect the generated config-3.12-darwin directory and its linker flags. Compare the result with the Homebrew example; done means the reported library path or equivalent linking information is available so the conda Python shared library can be linked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100