Skip to content
This repository was archived by the owner on Dec 6, 2021. It is now read-only.

Commit 95bf437

Browse files
author
rykeenan
committed
edit linux_ros_anaconda_warning.md
1 parent c53032e commit 95bf437

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

doc/linux_ros_anaconda_warning.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Upon completion of the Anaconda install, you should have a new Anaconda environment called `RoboND` with all the packages you need. However, if you have ROS installed on your Linux machine you will most likely run into a conflict between Python installations due to the `PYTHONPATH` variable being set in your `/opt/ros/kinetic/setup.bash` file which gets sourced in your `.bashrc` file.
44

5-
The hallmark of this conflict is getting an import error when you go to import packages that you just installed using Anaconda. First you fire up Python at the command line and everything looks normal:
5+
The hallmark of this conflict is getting an import error when you go to import packages that you just installed using Anaconda. To test whether you have this problem, first you fire up Python at the command line:
66

77
```sh
88
$ python
@@ -28,6 +28,13 @@ The solution is to unset your `PYTHONPATH` variable before sourcing your Anacond
2828
$ unset PYTHONPATH
2929
$ source activate RoboND
3030
```
31-
And it should work! But you need to remember to do this each time you want to use your Anaconda Python install.
31+
And it should work! But in this case, you'll need to remember to do this each time you want to use your Anaconda Python install.
3232

33-
An alternative solution is to remove the line `source /opt/ros/kinetic/setup.bash` from your `.bashrc` file, but that means you'll need to manually execute that command each time you want to use ROS. See [this post](https://stackoverflow.com/questions/43019951/after-install-ros-kinetic-cannot-import-opencv) and [this post](https://stackoverflow.com/questions/17386880/does-anaconda-create-a-separate-pythonpath-variable-for-each-new-environment) for more information on the matter.
33+
For a more permanent solution, you can add the `unset PYTHONPATH` line to your `.bashrc` file, but you need to make sure you drop it into the right location, after sourcing ROS. To do this, open your `.bashrc` file (should be located in your `~/` directory) and find the line that says `source /opt/ros/kinetic/setup.bash` and make this edit:
34+
35+
```
36+
source /opt/ros/kinetic/setup.bash
37+
unset PYTHONPATH
38+
```
39+
40+
See [this post](https://stackoverflow.com/questions/43019951/after-install-ros-kinetic-cannot-import-opencv) and [this post](https://stackoverflow.com/questions/17386880/does-anaconda-create-a-separate-pythonpath-variable-for-each-new-environment) for more information on the matter.

0 commit comments

Comments
 (0)