[bug] Building Conan itself fails
Describe the bug
Hello,
for historical reasons we build Conan from source on all of our required architectures. Recently the builds started to fail on macOS.
I was able to create a reproducer and have it fail on a GitHub Actions Runner here with:
self.initialize_options()
/Users/runner/work/conan-build-issue/conan-build-issue/_pyenv/bin/python3: No module named pip
Some observations:
- It only fails on macOS
- Also older Conan versions that used to succeed building now fail (which makes me suspect some updated Python dependency on Pypi side)
Could you please take a look?
Thanks, Gregor
PS: Are the build recipes for the official Conan releases available somewhere?
How to reproduce it
Clone https://github.com/gjasny/conan-build-issue and run build.sh locally.
This seems to do the trick:
+pip install --upgrade pip
pip install -e .
pip install pyinstaller
Would you be able to add pip to the pyproject.toml and tighten the dependency versions to something recent here?
https://github.com/conan-io/conan/blob/f7e431f1bac9c52c60f782854e262165f75d5257/pyproject.toml#L2
Hi @gjasny,
Yes, it looks like updating pip solves the issue.
Based on my tests here, it seems the macOS CI environment was using an older version of pip (21.x). When running pip install -e ., this older pip version used the old, deprecated setup.py develop method. For some reason, this method failed on that specific macOS setup when trying to invoke pip internally (No module named pip).
By adding python -m pip install --upgrade pip right after activating the virtual environment, you update pip to a recent version (like 25.x). As you saw, this newer pip version uses the modern build system defined in pyproject.toml for editable installs (-e), which avoids the problematic setup.py develop path entirely. The key factor driving the build method choice seems to be the pip version itself.
Would you be able to add pip to the pyproject.toml and tighten the dependency versions to something recent here?
I think we can't add pip to requires because that section lists dependencies needed by the build itself (like setuptools) to build the wheel, not the tool running the installation.
Anyway, I think this is probably something we want to document or add a comment somewhere.
Thanks a lot for the feedback and the detailed report!
Moved to the docs repo, to clarify it in the docs