Matlab rosinit error:Could not install the required Python packages.

조회 수: 10 (최근 30일)
庆 苏
庆 苏 2021년 10월 10일
답변: Jagadeesh Konakalla 2023년 4월 18일
Hi:
I want to use ros and matlab to realize co-simulation, but when I input rosinit in matlab, the following error appears:
matlab 2020b,updata6
Could not install the required Python packages. System error message:
'"C:\Users\t\AppData\Roaming\MathWorks\MATLAB\R2020b\ros1\win64\venv\Scripts\activate"'It is not an internal or external command, nor is it an executable program or batch file.
. Use pyenv function to set the path to the Python executable and retry the command.
I would appreciate your help.
  댓글 수: 3
庆 苏
庆 苏 2021년 10월 11일
Thank you very much for your reply,but I've solved this problem. This problem occurred because I used matlab2020b at the beginning, and there were problems with the ros toolkit before update2. Therefore, when I used the rosinit command, the ros1 folder was generated, but the subsequent packages could not be downloaded. After that, I updated and set up update6. Since the ros1 folder was generated before, I failed to regenerate it correctly this time, which caused the subsequent packages to fail to download. Deleting the original ros1 and this problem resolved.
sven lack
sven lack 2022년 2월 4일
Hi, thank you very much for sharing your solution. I had a similar problem. After the command "rosinit" the following error message came up:
>> rosinit
Launching ROS Core...
Could not create Python virtual environment.
'C:\Users\<user_name>\AppData\Roaming\MathWorks\MATLAB\R2020b\ros1\win64\venv\Scripts\python.exe' is not found. Verify installation of
Python in your system and re-create the Python virtual environment.
After some research, I came across the answer from B. W. Brokaw.
His tip solved the problem with the "virtual python enviornment" but led to a different error message:
>> rosinit
Launching ROS Core...
Adding required Python packages to virtual environment..Done.
Could not install the required Python packages. System error message: usage: python -m ensurepip [-h] [--version] [-v] [-U] [--user]
[--root ROOT] [--altinstall] [--default-pip]
python -m ensurepip: error: unrecognized arguments: --no-default-pip. Use pyenv function to set the path to the Python executable and retry the command.
Then I followed your hint and deleted the "C:\Users\<user_name>\AppData\Roaming\MathWorks\MATLAB\R2020b\ros1" folder. After that, the rosinit command worked without problems. Thank you!

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

답변 (1개)

Jagadeesh Konakalla
Jagadeesh Konakalla 2023년 4월 18일
https://de.mathworks.com/matlabcentral/answers/789104-could-not-create-python-virtual-environment#answer_682155

카테고리

Help CenterFile Exchange에서 Custom Message Support에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by