Ask Your Question
0

Using Psycopg2 and other libraries in sage

asked 2012-03-21 20:20:21 -0500

anonymous user

Anonymous

Hi,

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.

Thanks,

Matthew

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

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

Shashank gravatar image

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

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 http://pypi.python.org/simple/asciita... and http://cxc.harvard.edu/contrib/asciit... finds the latest version and installs it.

(sage subshell) galileo:~ shashank$ easy_install asciitable
Searching for asciitable
Reading http://pypi.python.org/simple/asciitable/
Reading http://cxc.harvard.edu/contrib/asciitable
Best match: asciitable 0.8.0
Downloading http://pypi.python.org/packages/source/a/asciitable/asciitable-0.8.0.zip#md5=27e42e69f8114e54724cd81ef1d0e88d
Processing asciitable-0.8.0.zip
Running asciitable-0.8.0/setup.py -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
SAGE_ROOT=/home/shashank/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux
edit flag offensive delete link more

Comments

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 -0500 )edit
1

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 -0500 )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 -0500 )edit
0

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

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 setup.py used to install. Is that were I should start e.g. "easy_install 'home/la/asciitable/setup.py'?

OR

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/asciitables.py

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

Hope this is clear.

Thanks

I already have asciiread install in my python

edit flag offensive delete link more

Comments

Please have a look at updated answer.

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

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

Jason Grout gravatar imageJason Grout ( 2012-03-24 15:13:14 -0500 )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

Stats

Asked: 2012-03-21 20:20:21 -0500

Seen: 551 times

Last updated: Mar 23 '12