Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Python setup

2,364 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Python setup

  1. 1. NLTKPython NLTK Study at Kauli 2011. 07. 26 Nekoya
  2. 2. NLTK
  3. 3. OK
  4. 4. CentOS NLTKPython
  5. 5. Python CentOS 5.5 - Python 2.4.3 2.6
  6. 6. EPELhttp://fedoraproject.org/wiki/EPEL epel-release-5-4.noarch.rpm
  7. 7. EPEL$ sudo rpm -ivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
  8. 8. Python2.6 RPM$ sudo yum install python26python26-libs python26-devel
  9. 9. virtualenv /usr/local Sandbox Python
  10. 10. virtualenv virtualenvwrapper pythonbrew
  11. 11. virtualenv$ sudo yum install python-virtualenv
  12. 12. virtualenv$ virtualenv --python=/usr/bin/python26/nltk/python /nltk/python/ virtualenv
  13. 13. virtualenv$ source /nltk/python/bin/activate virtualenv active .bashrc OK
  14. 14. mod_wsgi Apache WSGI (?) uWSGI
  15. 15. mod_wsgi uWSGI server-status
  16. 16. mod_wsgi$ sudo yum install python26-mod_wsgi mod_wsgi 2.4
  17. 17. httpd.confLoadModule wsgi_module modules/python26-mod_wsgi.soWSGIPythonHome "/nltk/python"#WSGIPythonPath "/nltk/python/lib/python2.6/site-packages"<VirtualHost *:80> ServerName localhost WSGIScriptAlias / /nltk/test.py</VirtualHost>
  18. 18. wsgi application import nltkfrom wsgiref import simple_serverdef application(environ, start_response):    start_response(200 OK, [(Content-type, text/plain)])    return dir(nltk)if __name__ == __main__:    server = simple_server.make_server(, 5000, application)    server.serve_forever()

×