Using couchdb in sagemath
For using couchdb you need to recompile the sagemath-python with ssl-support. This is quite easy:
- Download the python package e.g: python-2.6.4.p11.spkg
- wether you use the safe part (first) or do it directly (second)
- first way
rename it to: python-2.6.4.p11.tar.bz2
- unpack it
- second way
unp python-2.6.4.p11.spkg
edit the Setup.Dist like it is explained here: http://www.webtop.com.au/blog/compiling-python-with-ssl-support-fedora-10-2009020237
This is the interesting part
1 Now I had to modify the file Modules/Setup.dist in the Python source (mine was located in /usr/local/src/Python-2.6.1). Change the following lines (highlighted in red).
2 > vi Modules/Setup.dist
3 ...
4
5 206 # CSV file helper
6 207 #_csv _csv.c
7 208
8 209 # Socket module helper for socket(2)
9 210 _socket socketmodule.c
10 211
11 212 # Socket module helper for SSL support; you must comment out the other
12 213 # socket line above, and possibly edit the SSL variable:
13 214 #SSL=/usr/local/ssl
14 215 _ssl _ssl.c \
15 216 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
16 217 -L$(SSL)/lib -lssl -lcrypto
17 218
18 219 # The crypt module is now disabled by default because it breaks builds
19 220 # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
20 221 #
21 222 # First, look at Setup.config; configure may have set this for you.
22 223
23 224 #crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
- uncomment line 210 and 215-217. Maybe in your version the line numbers are different.
pack it again with: tar -cjf python-2.6.4.p11.spkg ./python-2.6.4.p11/
now you need to force the install in sage with: /usr/local/sage-4.7.1/sage -f python-2.6.4.p11.spkg (change it to your path!!)
== now you can install the couchdb python package ==;
start the sagemath sh-mode: /usr/local/sage-4.7.1/sage -sh
now there should be: (sage subshell) centre:~ root$
here you need to do e.g just: easy_install http://pypi.python.org/packages/2.6/C/CouchDB/CouchDB-0.8-py2.6.egg#md5=b47f8fe5f0c76d7c45bf8e4805d43de4
The link for the current version you will find here: http://pypi.python.org/pypi/CouchDB
If you want to use a local couchdb-Server you will have to install it on your local machine. For debian/ubuntu do sudo apt-get install couchdb in a terminal.