Ask Your Question
0

How to import nonstandard python packages in sage nb

asked 2012-01-16 14:36:53 +0100

kartikv gravatar image

I am trying to import a non-standard python package (particularly, theano) into sage: I can copy the package to the main sage directory to allow me to import it from the command line, but it does not seem to like doing it inside the notebook. For reference, my sage is in /usr/local/sage-4.7.2/, and the package is just a folder inside (with the usual __init__.py).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-01-16 15:50:48 +0100

Shashank gravatar image

Start the notebook with following lines and replace path-to-module and module-name with whatever is appropriate in you case.

import sys
sys.path.append('path-to-module')
import module-name
edit flag offensive delete link more

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-01-16 14:36:53 +0100

Seen: 677 times

Last updated: Jan 16 '12