Ask Your Question

Using Psycopg2 and other libraries in sage

asked 2012-03-21 20:20:21 -0600

anonymous user



Seems like a simple question but have not found a good answer. Best way to use outside python libraries in SAGE in Ubuntu. Install in SAGE foulder if so (how?). Link in an IDE. I know how to do this in Pydev.



edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2012-03-22 02:12:01 -0600

Shashank gravatar image

updated 2012-03-23 11:15:41 -0600

try this at the terminal

$sage -sh
$easy_install 'python-module'

Edit: The command easy_install will download the module from internet and install it.

For eg. If you type easy_install asciitables you get the following output. Notice it goes to the websites and finds the latest version and installs it.

(sage subshell) galileo:~ shashank$ easy_install asciitable
Searching for asciitable
Best match: asciitable 0.8.0
Running asciitable-0.8.0/ -q bdist_egg --dist-dir /tmp/easy_install-vcITTN/asciitable-0.8.0/egg-dist-tmp-S2CmQN
zip_safe flag not set; analyzing archive contents...
asciitable.version: module references __file__
Adding asciitable 0.8.0 to easy-install.pth file

Installed /home/shashank/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/python2.6/site-packages/asciitable-0.8.0-py2.6.egg
Processing dependencies for asciitable
Finished processing dependencies for asciitable
edit flag offensive delete link more


ah my easy install is not going to the internet for some reason on asciitables but it does for simpy (I have no idea why). So that explains why it was not working for me. Thanks Matthew

mcm3 gravatar imagemcm3 ( 2012-03-26 12:33:03 -0600 )edit

Also maybe this should be put in a wiki somewhere as I found this important but hard to track down.

mcm3 gravatar imagemcm3 ( 2012-03-26 12:35:05 -0600 )edit

I don't use asciitables so tried it out a few days ago just for the purpose of this question and it worked for me. Maybe the servers were busy when you tried.

Shashank gravatar imageShashank ( 2012-03-26 12:38:23 -0600 )edit

answered 2012-03-23 10:41:49 -0600

mcm3 gravatar image

Could not get it to work. Maybe its me.

sage -sh (OK) easy_install 'python-module' (does not work)

I don't think I know exactly what to put or it just not the way to install. Say I have a module like asciiread located in home/la/asciitable/. In that file are folders and used to install. Is that were I should start e.g. "easy_install 'home/la/asciitable/'?


is easy install in this case a way to link with my already install package.

so I put something like easy_install '/usr/local/lib/python2.6/dist-package/

Processing error: Couldn't find a setup script in /usr/local/lib/python2.6/dist-packages/atpy/

Hope this is clear.


I already have asciiread install in my python

edit flag offensive delete link more


Please have a look at updated answer.

Shashank gravatar imageShashank ( 2012-03-23 11:16:00 -0600 )edit

If you want to install the version you downloaded, you can go to the directory that has and do something like `sage install`

Jason Grout gravatar imageJason Grout ( 2012-03-24 15:13:14 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-03-21 20:20:21 -0600

Seen: 512 times

Last updated: Mar 23 '12