Use Customed Python Environment in ROS
Install Denpendent Packages
In ROS, if we use our special python environment under conda
or virtualenv
instead of the basic python environment,
there will be something wrong when we use ROS package. This is because ROS packages cannot be found in our special environment.
In order to resolve this problem, we need to install ROS packages in our python enviornment. Open a terminal and enter the following codes to install ROS dependencies.
1 | $ conda activate yourEnv |
Specify the Python Interpreter
In order to use our special environment, we have to assign the python interpreter in our python file. Add the following code on the first line of your python file.
1 | #! /path/to/python3 |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment