Error when trying to use 'rosinit' command

조회 수: 6 (최근 30일)
Mattia Waitz
Mattia Waitz 2021년 10월 20일
댓글: Jagadeesh Konakalla 2021년 10월 21일
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.

답변 (1개)

Jagadeesh Konakalla
Jagadeesh Konakalla 2021년 10월 21일
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
Mattia Waitz
Mattia Waitz 2021년 10월 21일
Sorry for the continuous disturb, but I have one last question: how can I retrieve the maci version? I downloaded the 2.7.18 from python.org, which I assume is an intel version especially since it dates back to early 2020. As far as the path goes, the command I write down is the following
>> pyenv('Version','/Applications/Python2.7');
which returns a message saying that it can't find any valid executable.
Again sorry for the disturb and thanks for the kind responses.
Mattia
Jagadeesh Konakalla
Jagadeesh Konakalla 2021년 10월 21일
Hi Mattia,
I think it is installed in /usr/local/bin.
So, try the following. It should work
>>pyenv("Version","/usr/local/bin/python")

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by