Ask Your Question

Andrew's profile - activity

2019-10-29 06:11:53 -0500 received badge  Great Question (source)
2017-09-19 23:21:31 -0500 received badge  Good Question (source)
2017-08-02 08:34:01 -0500 received badge  Famous Question (source)
2017-05-10 04:02:04 -0500 received badge  Notable Question (source)
2017-04-20 04:06:04 -0500 received badge  Popular Question (source)
2016-11-06 12:24:14 -0500 received badge  Nice Question (source)
2016-11-06 09:58:31 -0500 received badge  Student (source)
2016-11-06 09:48:19 -0500 asked a question Importing Python packages into Sage or Vice Versa

Hi all,

this is my first post. I'm a long time user of Python, and I'm fairly new to Sage. I'm using Ubuntu, if this helps. Currently, python doesn't recognize any of Sage's packages, and Sage can't import even standard Python packages like pandas.

I've looked at various instructions online about how to import sage packages into python and vice versa, but they all seem incredibly intricate, and none of them seem to work for me.

Here are a few attempts that I made:

  1. Running "sudo sagemath --python -m easy_install pandas" in terminal. (Still can't import pandas while running sage; even after running: "sys.path.append('/usr/lib/sagemath/local/lib/python2.7/site-packages/pandas-0.19.1-py2.7-linux-x86_64.egg')" from within sage.)
  2. Following the instructions in the "import sage packages in python" question. (I don't have enough karma to post links.)
  3. Doing various bizzarre attempts at changing sage_root or adding to it my python path.
  4. Attempting to import pip while running sage, and install pandas this way. (Can't import pip.)

I tried a few more things (like downloading packages and "build"ing them, and then doing a few more very technical and annoying things), and all of my attempts fail. Is there really no simple way to do this? What is the most fool-proof way to do this that exists? It would be enormously helpful for me to be able to use python packages while working in sage, or vice versa.