Installed R package not available in Python (Anaconda)

0 views
Skip to first unread message

Truls Andersen

unread,
Mar 18, 2017, 7:16:27 AM3/18/17
to conda - Public
Hi, 

I recently downloaded and installed Anaconda and i'm trying to run some pre-made python (2.7) scripts that I need for work. The scripts requires a package called "maptools", and uses the function "from maptools import *", which in itself is understandable. When I run the script, i get the this message: ImportError: No module named maptools

So, I go the conda page and find the package, and install the package using this command in the terminal: conda install -c r r-maptools=0.8_40

I hoped that would solve the issue, but still when I run the script I get the same message. I'm a little at a loss as to actually install this package (Yes, i'm not very capable using python, never used it before), and any help as how I can get the package to work would be greatly appreciated. 

Cheers,
T

Ray Donnelly

unread,
Mar 18, 2017, 8:13:17 AM3/18/17
to Truls Andersen, conda - Public
You cannot import R libraries into Python like this. They are entirely different languages. R libraries are loaded into the R interpreter. You can bridge between Python and R using the rpy2 package though.

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/20ab0e13-1809-4923-bba8-753c2187a07e%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Truls Andersen

unread,
Mar 18, 2017, 8:43:39 AM3/18/17
to conda - Public, truls...@hotmail.com
Thanks for the quick reply. 

That does of course make sense, I just don't see how these pre-made python scripts were running for someone else if the implementation of this package does not work. I'll try to have a look at the rpy2 package and maybe I can find a way to make it work. 

Thanks again.

Cheers,
T

Ray Donnelly

unread,
Mar 18, 2017, 8:49:36 AM3/18/17
to Truls Andersen, conda - Public
No problem. If your script is shareable I can maybe advise further.

Chris Barker

unread,
Mar 20, 2017, 12:16:58 PM3/20/17
to Truls Andersen, conda - Public
I recently downloaded and installed Anaconda and i'm trying to run some pre-made python (2.7) scripts that I need for work. The scripts requires a package called "maptools", and uses the function "from maptools import *", 

this sure looks like Python -- or does R have the same import syntax?

Anyway, maybe there is a Python package named "maptools"?

I would look and see if there is any documentation about the dependencies of that script.

-CHB


Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov
Reply all
Reply to author
Forward
0 new messages