Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect PYTHONPATH on Ubuntu 10.04 #635

Closed
smits opened this issue May 20, 2014 · 7 comments
Closed

Incorrect PYTHONPATH on Ubuntu 10.04 #635

smits opened this issue May 20, 2014 · 7 comments

Comments

@smits
Copy link
Contributor

smits commented May 20, 2014

Hi all,

I'm trying to use catkin on an older Ubuntu version due to legacy reasons. I've installed python2.7 on it from ppa:fkrull/deadsnakes and made sure I have CMake 2.8.3. I'm using virtualenv to make sure that catkin uses python2.7 since all catkin shebangs are without python version. Although it seems catkin is building ok the generated _setup_util.py exports the wrong PYTHONPATH:

grep PYTHONPATH /opt/ros/hydro/_setup_util.py

        'PYTHONPATH': 'lib/python./site-packages

For some reason the MAJOR and MINOR versions are empty. I've skimmed through the catkin sources but cannot find where this CMake variables get set.

@dirk-thomas
Copy link
Member

The template used for the _setup_util.py file uses the CMake variable PYTHON_INSTALL_DIR (see

'PYTHONPATH': '@PYTHON_INSTALL_DIR@',
).

This CMake variable is computed in

set(PYTHON_INSTALL_DIR lib/python${_PYTHON_PATH_VERSION_SUFFIX}/${PYTHON_PACKAGES_DIR}
but you should see a message during the configure step which states the Python version being used (
message(STATUS "Python version: ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
).

There is a second code path for the tools catkin_make / catkin_make_isolated in Python. May be you can add some debug out there if the CMake part is not responsible:

def get_python_install_dir():

@wyc
Copy link
Member

wyc commented May 22, 2014

Please see #636

@smits
Copy link
Contributor Author

smits commented May 22, 2014

The patch provided in #636 fixes my issue!

@dirk-thomas
Copy link
Member

@smits Could you please provide some information after trying it on your machine why the Python version was not extracted for you? I think it would still be valuable to understand why it failed in the first place - e.g. the proposed patch relies on invoking Python which is performance wise always something to reconsider.

@dirk-thomas
Copy link
Member

@smits See previous comment.

@smits
Copy link
Contributor Author

smits commented Jun 12, 2014

Update: I was using indigo-devel instead of groovy-devel. With the original groovy-devel my issue is resolved even without #636

@smits smits closed this as completed Jun 12, 2014
@dirk-thomas
Copy link
Member

Thank you for clarifying the reason why this happened for you.

@dirk-thomas dirk-thomas modified the milestone: untargeted Jun 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants