Error when trying to use 'rosinit' command
Show older comments
I'm very new to ROS and when I try to launch the 'rosinit' command on my M1 mac i receive the following message/error:
>> rosinit
Launching ROS Core...
Adding required Python packages to virtual environment..chmod: /Users/mattiawaitz/.matlab/R2021a/ros1/maci64/venv/bin/activate: No such file or directory
bash -c 'PATH=$PATH:/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS ; /Users/mattiawaitz/.matlab/R2021a/ros1/maci64/venv/bin/activate ; DYLD_LIBRARY_PATH=/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/lib /Users/mattiawaitz/.matlab/R2021a/ros1/maci64/venv/bin/python -m ensurepip --upgrade --no-default-pip -v -v -v': Killed
Done.
Could not install the required Python packages. System error message: bash:
/Users/mattiawaitz/.matlab/R2021a/ros1/maci64/venv/bin/activate: No such file or directory
bash: line 1: 91406 Killed: 9
DYLD_LIBRARY_PATH=/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/lib
/Users/mattiawaitz/.matlab/R2021a/ros1/maci64/venv/bin/python -m ensurepip --upgrade --no-default-pip -v -v -v
. Use pyenv function to set the path to the Python executable and retry the command.
I've installed Python 2.7 as requested by the help page and already tried using the 'pyenv' command as suggested by MATLAB in the last line.
Answers (1)
Jagadeesh Konakalla
on 21 Oct 2021
1 vote
Can you try the following once and let me know ?
>> pyenv('Version',<path to python 2.7>);
>> ros.internal.createOrGetLocalPython(true);
>> rosinit
Thanks and regards,
Jagadeesh
4 Comments
Mattia Waitz
on 21 Oct 2021
Jagadeesh Konakalla
on 21 Oct 2021
Hi Mattia,
I agree that issue is with Apple M1 hardware only. Please try my below suggestion and let me know.
I have received the same error as you posted now, when i used the default Python 2.7 available with M1 mac on one of our lab machine. I have the maci (intel) version Python executable on shared drive. So, I have provided the maci Python path to Pyenev and ran the rosinit and it worked.
Please note that MATLAB does not support natively on Apple M1. In the future release, the native supprt for M1 will be available. For now, MATLAB uses rosetta environment to run on the Apple M1 hardware. For more information please see the following link.
Thanks and regards,
Jagadeesh K.
Mattia Waitz
on 21 Oct 2021
Jagadeesh Konakalla
on 21 Oct 2021
Hi Mattia,
I think it is installed in /usr/local/bin.
So, try the following. It should work
>>pyenv("Version","/usr/local/bin/python")
Categories
Find more on Call Python from MATLAB 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!