catkin / catkin_tools

Command line tools for working with catkin
Apache License 2.0
164 stars 146 forks source link

catkin_tools on Groovy without sudo #118

Closed davetcoleman closed 10 years ago

davetcoleman commented 10 years ago

I'm trying to install catkin_tools on a Groovy Baxter robot without sudo access. I do the following:


Install catkin_tools

First edit your .bashrc and add:

 export PYTHONPATH="/home/ruser/bin/catkin_tools/lib/python2.7/site-packages:$PYTHONPATH"

Source your .bashrc then

 cd ~/ros
 git clone https://github.com/catkin/catkin_tools.git
 cd catkin_tools/
 python setup.py install --prefix ~/bin/catkin_tools

Done.


I see my PYTHONPATH has been added but the catkin command is still not found. Additionally, when I go to /home/ruser/bin/catkin_tools/lib/python2.7/site-packages/catkin_tools-0.2.0-py2.7.egg/catkin_tools/commands and run python catkin.py I get no output. When I run python3 catkin.py I get:

__init__.py   __init__.pyc  catkin.py     catkin.pyc    
 commands$ python3 catkin.py
Traceback (most recent call last):
  File "catkin.py", line 19, in <module>
    import pkg_resources
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 45
    def _bypass_ensure_directory(name, mode=0777):
                                               ^
SyntaxError: invalid token

I am not very good at Python so am a little lost. Thanks!

jbohren commented 10 years ago

Take a look at this: https://www.osc.edu/documentation/howto/install-your-own-python-modules

The issue is that the catkin program is generated when the package gets installed, not when the package gets built. You need that generated script on your PATH environment variable.

wjwwood commented 10 years ago

I recommend that you use a virtualenv: http://virtualenv.readthedocs.org/en/latest/

I'm going to close this for now, please comment here again if there is a problem specifically with catkin_tools related to virtualenv's.

P.S. You should never expect a call to python3 to work when you have a Python2 path in your PYTHONPATH. As you can see the failure is in a core Python module pkg_resources.

davetcoleman commented 10 years ago

Thanks