Using rosgenmsg() for ROS custom message in MATLAB 2021 generation
Show older comments
Hi,
I am trying to generate custom ROS messages using rosgenmsg() following the link below.
However, Matlab keeps telling me
"Could not install the required python packages. "
"ros.internal.createOrgetLocalPython(); % ensure python is available"
IN addiiton, my default python version is 3.8 and I have changed it to 2.7 by using
pyenv('Version','/usr/bin/python2.7'), where /usr/bin/python2.7 is the full path of my python executable.
4 Comments
Jagadeesh Konakalla
on 18 May 2021
Hi,
Looks like python environment required for MATLAB is not set properly.
Can you run the following function to recreate the python virtual environment before running rosgenmsg ?
% % Re-create Python virtual environment
pyenv('Version','/usr/bin/python2.7');
ros.internal.createOrGetLocalPython(true);
Let me know if this works.
Jagadeesh K
Zi Huang
on 21 May 2021
Zi Huang
on 22 May 2021
Nathaniel Goldfarb
on 12 Sep 2021
were you able to solve your problem?
Answers (1)
Murat Belge
on 18 May 2021
Moved: Jagadeesh Konakalla
on 12 Apr 2024
0 votes
Can you execute the following command on bash and tell us the output?
$ /usr/bin/python2.7 --version
$/usr/bin/python2.7 -m pip --version
It looks like the version of the pip installed is not supported by Python 2.7, hence the syntax error from the pip.
Categories
Find more on Get Started with ROS Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!