Closed martinaxgloria closed 9 months ago
No, sudo
should never be necessary when operating inside conda environments (and pixi under the hood creates a conda environment). I guess you had some previous version of urdf_parser_py
/ urdfdom_py
installed in the system via sudo? That however is strange, in theory it should not be visible by conda.
Can you please report the output of pip list --verbose
outside the pixi environment, and the out of env
?
As the error complains that urdfdom-py 1.2.1
is already installed, I guess I know what is happening: you have urdfdom-py installed via ROS2, and probably the PYTHONPATH env variable is leaking python packages that are not related to the conda environment.
As the error complains that
urdfdom-py 1.2.1
is already installed, I guess I know what is happening: you have urdfdom-py installed via ROS2, and probably the PYTHONPATH env variable is leaking python packages that are not related to the conda environment.
Indeed, I just replicated the failure with:
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt install ros-humble-urdfdom-py
source /opt/ros/humble/setup.sh
and then
traversaro@IITBMP014LW012:~/test3/icub-models-generator$ pixi run test_generated_models
✨ Pixi task (default): echo Automatic build of models via icub-models-generator. > ./deploy_commit_message
✨ Pixi task (default): echo ### Dependencies information of dependencies installed manually: >> ./deploy_commit_message
✨ Pixi task (default): export URDF_PARSER_PY_COMMIT=31474b9baaf7c3845b40e5a9aa87d5900a2282c3 && pip install git+https://github.com/ros/urdf_parser_py.git@$URDF_PARSER_PY_COMMIT --no-deps && echo urdf_parser_py commit: ros/urdf_parser_py@$URDF_PARSER_PY_COMMIT >> ./deploy_commit_message
Collecting git+https://github.com/ros/urdf_parser_py.git@31474b9baaf7c3845b40e5a9aa87d5900a2282c3
Cloning https://github.com/ros/urdf_parser_py.git (to revision 31474b9baaf7c3845b40e5a9aa87d5900a2282c3) to /tmp/pip-req-build-3d7g5llz
Running command git clone --filter=blob:none --quiet https://github.com/ros/urdf_parser_py.git /tmp/pip-req-build-3d7g5llz
Running command git rev-parse -q --verify 'sha^31474b9baaf7c3845b40e5a9aa87d5900a2282c3'
Running command git fetch -q https://github.com/ros/urdf_parser_py.git 31474b9baaf7c3845b40e5a9aa87d5900a2282c3
Running command git checkout -q 31474b9baaf7c3845b40e5a9aa87d5900a2282c3
Resolved https://github.com/ros/urdf_parser_py.git to commit 31474b9baaf7c3845b40e5a9aa87d5900a2282c3
Preparing metadata (setup.py) ... done
Building wheels for collected packages: urdfdom_py
Building wheel for urdfdom_py (setup.py) ... done
Created wheel for urdfdom_py: filename=urdfdom_py-0.3.3-py3-none-any.whl size=13006 sha256=6dde5dd835c7790a9d32a6fe0f731737e6805642bf62289b60552774a4996ca6
Stored in directory: /home/traversaro/.cache/pip/wheels/53/6d/23/a9c5a6b60dcfe19b179860b42187516458e778fce6e4e36e09
Successfully built urdfdom_py
Installing collected packages: urdfdom_py
Attempting uninstall: urdfdom_py
Found existing installation: urdfdom-py 1.2.1
Uninstalling urdfdom-py-1.2.1:
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: 'urdf.py'
Consider using the `--user` option or check the permissions.
@martinaxgloria fyi executing the pip install with sudo probably you corrupted your ROS apt installation, you probably can reinstall the ros-humble-urdfdom-py
to fix this.
Anyhow, this is indeed quite confusing, I reported the issue to pixi devs at https://github.com/prefix-dev/pixi/issues/826 .
Can you please report the output of
pip list --verbose
outside the pixi environment, and the out ofenv
?
Could you try to add the following:
Put the following in the file: clean_env.sh
:
export PYTHONPATH=
export PYTHONUSERBASE=disabled_by_wrong_value
and add it to the pixi.toml
via:
[activation]
scripts = ["clean_env.sh"]
And then restart you pixi shell
or pixi run
Hi @ruben-arts, thanks for the reply. I created a new file clean_env.sh
in the same path as the pixi.toml
and I did what you suggested. Running pixi run
worked with no errors
@traversaro do you think that this workaround is let's say less cumbersome than https://github.com/robotology/icub-models-generator/pull/263?
Awesome :100:
We'll have something like:
[activation]
env = { PYTHONPATH = "" }
Which would make it even easier and clearer to the user but for now this is the easiest workaround as it also adds it to the pixi shell
.
Full isolation is something we still have to find a solution for. Stay posted :smile:
@ruben-arts thanks for chiming in!
@traversaro do you think that this workaround is let's say less cumbersome than #263?
For sure, feel free to update the PR or open a new one (you should have access now).
Thanks @ruben-arts and @martinaxgloria, fixed in https://github.com/robotology/icub-models-generator/pull/263 .
After https://github.com/robotology/icub-models-generator/pull/261, I tried to use new
pixi
features to generate the model to debug https://github.com/robotology/icub-models-generator/pull/260. Following the instructions in the README.md, when running:I obtained:
Probably it's due to a missing
sudo
inurdfdom_py
installation I guess. In fact, adding a sudo in here:https://github.com/robotology/icub-models-generator/blob/f0f2099dc85885b816ceb2209471c67578eaeaab/pixi.toml#L16
no errors where retrieved in the generation of the models.
cc @traversaro @Nicogene