在 Ubuntu 14.04.1 LTS 桌面系统里安装了 pycharm-4.5.4,Linux 下的 pycharm 是通过 java 来运行的,所以需要安装 Java jdk.
安装命令很简单
sudo apt-get install openjdk-7-jdk
Tornado 是 FriendFeed 使用的可扩展的非阻塞式 web 服务器及其相关工具的开源版本。这个 Web 框架看起来有些像web.py 或者 Google 的 webapp,不过为了能有效利用非阻塞式服务器环境,这个 Web 框架还包含了一些相关的有用工具 和优化。
Tornado 和现在的主流 Web 服务器框架(包括大多数 Python 的框架)有着明显的区别:它是非阻塞式服务器,而且速度相当快。得利于其 非阻塞的方式和对 epoll 的运用,Tornado 每秒可以处理数以千计的连接,这意味着对于实时 Web 服务来说,Tornado 是一个理想的 Web 框架。我们开发这个 Web 服务器的主要目的就是为了处理 FriendFeed 的实时功能 ——在 FriendFeed 的应用里每一个活动用户都会保持着一个服务器连接。(关于如何扩容 服务器,以处理数以千计的客户端的连接的问题,请参阅 C10K problem。)
请参见 Tornado 文档 或 Tornado 原文文档(镜像)以详细了解该 Web 框架。
Tornado 官网:http://www.tornadoweb.org/en/stable/
下面是安装的最新版 Tornado 4.2.1,本应该下载 .tar.gz 包来手动安装,及其它的基础包的,方便以后服务器上安装统一的环境。
但是这次使用的 pip 安装,安装命令如下:
$ sudo pip install tornado Downloading/unpacking tornado Downloading tornado-4.2.1.tar.gz (434kB): 434kB downloaded Running setup.py (path:/tmp/pip_build_root/tornado/setup.py) egg_info for package tornado no previously-included directories found matching 'docs/build' warning: no files found matching 'tornado/test/README' Downloading/unpacking backports.ssl-match-hostname (from tornado) Downloading backports.ssl_match_hostname-3.4.0.2.tar.gz Running setup.py (path:/tmp/pip_build_root/backports.ssl-match-hostname/setup.py) egg_info for package backports.ssl-match-hostname Downloading/unpacking certifi (from tornado) Downloading certifi-2015.9.6.2-py2.py3-none-any.whl (371kB): 371kB downloaded Installing collected packages: tornado, backports.ssl-match-hostname, certifi Running setup.py install for tornado building 'tornado.speedups' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c tornado/speedups.c -o build/temp.linux-x86_64-2.7/tornado/speedups.o tornado/speedups.c:2:20: fatal error: Python.h: 没有那个文件或目录 #include <Python.h> ^ compilation terminated. /tmp/pip_build_root/tornado/setup.py:94: UserWarning: ******************************************************************** WARNING: The tornado.speedups extension module could not be compiled. No C extensions are essential for Tornado to run, although they do result in significant speed improvements for websockets. The output above this warning shows how the compilation failed. Here are some hints for popular operating systems: If you are seeing this message on Linux you probably need to install GCC and/or the Python development package for your version of Python. Debian and Ubuntu users should issue the following command: $ sudo apt-get install build-essential python-dev RedHat, CentOS, and Fedora users should issue the following command: $ sudo yum install gcc python-devel If you are seeing this message on OSX please read the documentation here: http://api.mongodb.org/python/current/installation.html#osx ******************************************************************** "The output above " command 'x86_64-linux-gnu-gcc' failed with exit status 1 no previously-included directories found matching 'docs/build' warning: no files found matching 'tornado/test/README' Running setup.py install for backports.ssl-match-hostname Successfully installed tornado backports.ssl-match-hostname certifi Cleaning up... $ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tornado >>> tornado.version '4.2.1' >>>
OK,开工!
文章评论