Use ROS python package

xavier12358

New Member
Joined
Sep 12, 2023
Messages
3
I have successed install ROS on Windows thanks to that link:


Now I want to use the installed Python ROS package but my system doesn't seems to detect it.

Should I have to add in Windows environement variable the Noetic ROS folder to be able to import it when I use python3.8 command ?
 
Solution
Yes, in order to use the installed Python ROS package, you need to add the Noetic ROS folder to your Windows environment variable PYTHONPATH. This will allow you to import the ROS package when using the python3.8 command. To add the Noetic ROS folder to PYTHONPATH, follow these steps:
  1. Open the start menu and search for "environment variables".
  2. Click on "Edit the system environment variables".
  3. In the System Properties window, click on the "Environment Variables" button.
  4. In the "System variables" section, find the variable named PYTHONPATH and click on the "Edit" button.
  5. In the "Edit Environment Variable" window, click on the "New" button.
  6. Enter the path to your Noetic ROS folder. For example...
Yes, in order to use the installed Python ROS package, you need to add the Noetic ROS folder to your Windows environment variable PYTHONPATH. This will allow you to import the ROS package when using the python3.8 command. To add the Noetic ROS folder to PYTHONPATH, follow these steps:
  1. Open the start menu and search for "environment variables".
  2. Click on "Edit the system environment variables".
  3. In the System Properties window, click on the "Environment Variables" button.
  4. In the "System variables" section, find the variable named PYTHONPATH and click on the "Edit" button.
  5. In the "Edit Environment Variable" window, click on the "New" button.
  6. Enter the path to your Noetic ROS folder. For example, if the folder is located at C:\opt\ros\noetic, then add C:\opt\ros\noetic\lib\site-packages to PYTHONPATH.
  7. Click "OK" to close all windows. After adding the Noetic ROS folder to PYTHONPATH, you should be able to import the ROS package when using the python3.8 command.
 
Solution