Open christianrauch opened 3 months ago
Thank you for your question.
Unfortunately, the launch
package is not available on PYPI, so it cannot be added as a dependency during pip install.
Are you executing source /opt/ros/YOUR_DISTRO/setup.bash
after running ros-tooling/setup-ros
?
With Ubuntu 24.04 and PEP 668 the dependency management becomes a bit more difficult. It is now strongly recommended to use virtual environments to install packages via pip.
Installing colcon-lint
in a virtual environment, which inherits the "system-site-packages":
python3 -m venv --system-site-packages ~/.venvs/dev
. ~/.venvs/dev/bin/activate
pip install colcon-lint
will not install the direct dependencies, such as colcon-core
(from /usr/lib/python3/dist-packages
), again. Hence, after sourcing:
. ~/.venvs/dev/bin/activate
the "system" colcon will then fail to find the lint
verb.
Without --system-site-packages
the directly provided dependencies, such as colcon-core
, will be installed. But indirect dependencies, such as lark
, will be missing and cause:
File "/opt/ros/jazzy/lib/python3.12/site-packages/launch/frontend/parse_substitution.py", line 23, in <module>
from lark import Lark
ModuleNotFoundError: No module named 'lark'
That means that all system dependencies in /usr/lib/python3/dist-packages
have to be reinstalled in the virtual environment manually.
Do you have an idea how this can be resolved? Have you thought about adding the repo to the colcon organisation and create Debian packages, such as python3-colcon-clean
for colcon-clean
?
Yes, I am also struggling with handling Ubuntu 24.04 and PEP 668.
That means that all system dependencies in /usr/lib/python3/dist-packages have to be reinstalled in the virtual environment manually.
If you just want to bypass the dependencies installed on the system like lark and make them usable, you could add the system's Python package path (e.g. /usr/lib/python3/dist-packages
) to the sys.path
(or PYTHONPATH
) of the virtual environment. However, this is only a temporary measure.
Have you thought about adding the repo to the colcon organisation and create Debian packages, such as python3-colcon-clean for colcon-clean?
Transferring it to the colcon organization and making it installable via apt should make it easier to handle, so I plan to work on it when I have some time.
Nevertheless, it's still troubling that users cannot install and run colcon lint in a virtual environment according to PEP 668, but I'll set that aside for now.
I am trying to run
colcon lint
, installed viapip install colcon-lint
, withros-tooling/setup-ros
but it appears that the dependency onlaunch
has not been defined, hence it is missing: