1

I've installed Anaconda on my Mac so that I can use IPython easily.

It is working fine but I would like to add the original python libraries to the anaconda python so I can use the 'Foundation' class.

I assume that I need to add the right directory to some environment variable or add something to my IPython startup process but can't figure out what the directory should be or where to add it.

Matt
  • 24,656
  • 6
  • 74
  • 72
Tony Williams
  • 598
  • 2
  • 16

1 Answers1

1

If you want to get all of the possible locations based upon your python installation, you can find the enitrety of possible package locations via:

    import sys
    locations = sys.path

This will give you all possible places where your packages could live. If you have specific packages that you want to point to, you could do

   import moduleName
   location = moduleName.__file__
Galen Harrison
  • 192
  • 1
  • 9
  • OK, I did that and I now have a long list of paths used by /usr/bin/python. How do I get the anaconda python to use these as well as the paths it currently uses? – Tony Williams Jul 03 '15 at 04:56
  • Hm, I don't know that much about anaconda, specifically. If you wanted, you could try and do (in the ipython environment) sys.append(pathLocations), however you would need to do that every time you opened a new interpreter session. [This](http://stackoverflow.com/questions/17386880/does-anaconda-create-a-separate-pythonpath-variable-for-each-new-environment) and [this](http://stackoverflow.com/questions/3402168/permanently-add-a-directory-to-pythonpath) are probably good places to start. – Galen Harrison Jul 03 '15 at 05:17