elephantrobotics/mycobot_ros

Please do not suggest using `pip install --user` 😬

eacousineau opened this issue · 4 comments

Howdy! I'm tinkering with the robot now, and having fun!

That being said, things like sudo pip install and pip install --user can wreak havoc on an existing system, and kludge things on your PATH and PYTHONPATH. On multiple instances, I've had to fix things that were borked by shadowing, and/or help colleagues do the same.

I've tried the following with virtualenv, and it seems to work A-OK (think of it working kinda like linking ROS workspaces... but in this case we merge 'em hehe)

sudo apt install python3-virtualenv   # Ubuntu

cd ~/catkin_ws

# Do nominal build
catkin_make -j

# Now overlay w/ virtualenv
python3 -m virtualenv -p python2 --system-site-packages ./devel
./devel/bin/pip install pymycobot

source ./devel/setup.bash
...
python scripts/test.py
# Should still work.
roslaunch mycobot_ros mycobot_simple_gui.launch

Can you give me a detailed explanation?It's OK on my computer,no virtual environment is required。
sudo and --user should not be affected, but they should be installed in different packages sites.
You need to use the pip of python2 to install. By default, ROS kinetic uses python2.

@eacousineau You can also try to add to your shell

export PIP_REQUIRE_VIRTUALENV=true

so pip will not affect your system (only virtual envs).

You can also try to add to your shell [...]

Ermagherd, thank you!!!

Can you give me a detailed explanation?It's OK on my computer,no virtual environment is required。

I've added a relatively brief explanation here as well: zlj-zz/minimycobotflasher#1
Just from a quick search, I believe this post echoes the core of the issue: https://stackoverflow.com/a/61452956

I got it, it's better. But the problem is not each user like the vistual env.

This will increase the difficulty of using rookies, and they are also the objects we need to consider.