If you install rpy2 on Windows and try to use R objects or R magic commands you may see this error message:
To resolve this issue, follow these steps:
1. If you have not installed rpy2, install from the R channel on Anaconda Cloud:
conda install -c r rpy2
2. After the installation is complete, add the following directory paths to your PATH environment variable. This section can be found here:
Computer -> Properties -> Advanced System Settings -> Environment Variables
If Anaconda was installed for just you, edit the PATH variable for your user. If you have installed for all users, edit the system PATH which may require admin privileges.
Add the two following lines to the end of what is already there. Be sure the full path should matches your installation path and Anaconda directory name:
Your PATH should now have the following line for Anaconda and rpy2:
Close any open command prompts or python consoles, and relaunch them for the PATH to take effect.