python mongodb ubuntu

mongodb install:

sudo apt-get install mongodb

Install pip

1.

$ sudo apt-get install python-pip python-dev build-essential 
$ sudo pip install --upgrade pip 
$ sudo pip install --upgrade virtualenv 
pip install pymongo
(mysql:sudo pip install mysql-python;apt-get install mysql-server)
Or  To get a specific version of pymongo,As follow :
pip install pymongo==2.1.1

To upgrade using pip:
pip install --upgrade pymongo


For older version of ubuntu
 
Install Easy Install
$ sudo apt-get install python-setuptools python-dev build-essential 
Install pip
$ sudo easy_install pip 
Install virtualenv
$ sudo pip install --upgrade virtualenv
......如前面一样

资源:

mongo 权威指南
python 核心编程

python eclipse:
Install pydev plugin

还必须在Eclipse中添加Python interpreter。选择 Window > Preferences > Pydev > Interpreter - Python,单击new,在弹出的对话框的Name栏输入一个名字,随便起,如PythonInterpreter,然后在地址栏输入你的python程序的地址,ubuntu的默认python地址是/usr/bin/python,只要你不是后来又安装了新的python,直接用这个地址就可以了~

确定了之后,系统会自动搜索库文件,点击OK即可。



python GUI:
  • sudo aptitude install python-wxtools

python Wep:

Python的Web框架中,mod-python是一个很方便实用的,而且可以跟其他的框架一起使用的。

下面介绍一下Apache和mod-python的协作使用。

首先需要下载的软件有:python-2.5.1,apache_2.2.4,mod_python-3.3.1。

这些工具可以在Python官网、Apache官网和Sourceforge上下载到,具体链接就不给出来了。

依次安装Python、Apache和mod-python。

Apache的默认端口是80,因此在安装的时候需要禁用如IIS,JBoss等服务器程序。

安装之后,如果http://localhost/可以正常显示出来“It works”,那么就是安装成功了。

然后安装mod-python,它会自己寻找Python和Apache的安装路径,如果找不到的话,会让你选择的。

安装之后,在Apache2.2modules目录下会生成mod_python.so文件,

这个文件会处理和转发发送到Apache的Http请求mod-python。

接下来需要修改Apache的配置文件Apache2.2confhttpd.conf。

添加如下内容:LoadModule python_module modules/mod_python.so。

将DocumentRoot修改为一个访问比较方便的目录,比如D:PythonWeb。

然后添加其对应的Directory。

<Directory "D:PythonWeb">
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

然后在D:PythonWeb放一个HTML文件,如果能通过http://localhost/xxxx.html 访问的话,那就说明安装成功了。 

http://robrohan.com/2006/10/01/howto-setup-python-for-web-development-on-ubuntu/


原文地址:https://www.cnblogs.com/suncoolcat/p/3281394.html