Closed sundermann closed 1 year ago
colcon-core==0.8.1 fails with a similar error, however version 0.7.1 works fine:
[10.030s] ERROR:colcon.colcon_core.environment:Exception in environment extension 'pythonpath': '/usr/local/lib/python3.10/site-packages' is not in the subpath of '/Users/ssundermann/Sourcecode/ros2_humble/install' OR one path is relative and the other is absolute.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/colcon_core/environment/__init__.py", line 175, in create_environment_hooks
hooks = extension.create_environment_hooks(prefix_path, pkg_name)
File "/usr/local/lib/python3.10/site-packages/colcon_core/environment/pythonpath.py", line 28, in create_environment_hooks
rel_python_path = python_path.relative_to(prefix_path)
File "/usr/local/Cellar/python@3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pathlib.py", line 816, in relative_to
raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: '/usr/local/lib/python3.10/site-packages' is not in the subpath of '/Users/ssundermann/Sourcecode/ros2_humble/install' OR one path is relative and the other is absolute.
It seems that the python parts of the packages are installed to /usr/local/lib/python3.10/site-packages
instead of the ros2_humble/install/...
directory.
I was able to resolve these issues by reverting the switch to sysconfig and falling back to the deprecated distutils.
Hi @sundermann, can you please give #512 a try instead of reverting to the deprecated behavior?
Hi @cottsay. I installed your branch using python3 -m pip install -U git+https://github.com/colcon/colcon-core.git@cottsay/sitecustomize --force-reinstall
. Unfortunately, the install directory is still broken and colcon errors out with the same problems as before.
Well, it looks like Homebrew is engaging in the same shenanigans as Debian and Fedora, and we'll need to specifically work around it.
Here's the spot: https://github.com/Homebrew/homebrew-core/blob/2f008323193f636d32c4a970caa9e8b528c6c430/Formula/python%403.10.rb#L62-L68
Is there a hack or workaround available?
You'll need both #512 and #514 to get around the platform patch.
Having #512 and #514 applied fixes the issue on MacOS. Thanks!
Great news, thanks for reporting back.
On MacOS the pythonscriptspath extension fails with the following error:
I installed python3.10 through brew and symlinked it into /usr/local
The issue seems to be related to #504