Articles of python

无法在Ubuntu 12.04.2 LTS上安装python2.7-dev

命令$ sudo apt-get install python2.7-dev产生这样的结果: Reading package lists… Done Building dependency tree Reading state information… Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. […]

为什么在我尝试通过pip进行SciPy安装时,在RHEL上未检测到ATLAS?

我正在使用RHEL6,Python 2.6.6,并尝试通过pip安装SciPy。 [user@server ~]$ sudo pip install scipy <snip> atlas_blas_threads_info: Setting PTATLAS=ATLAS libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib64', '/usr/local/lib', '/usr/lib64/atlas'] NOT AVAILABLE <snip> 但是,当我列出/ usr / lib64 / atlas中的文件时: [user@server ~]$ ls /usr/lib64/atlas libcblas.so.3 libclapack.so.3.0 liblapack.so.3 libptcblas.so.3.0 libatlas.so.3 libcblas.so.3.0 libf77blas.so.3 liblapack.so.3.0 libptf77blas.so.3 libatlas.so.3.0 libclapack.so.3 libf77blas.so.3.0 libptcblas.so.3 libptf77blas.so.3.0 有任何想法吗?

在/etc/rc.local里运行python脚本不起作用

我在我的Amazon AWS AMI上修改了/etc/rc.local #!/bin/sh touch /var/lock/subsys/local # setup hostname properly /usr/bin/python /root/automation/initSystem.py 所以最后一行调用configuration(Envvariables,主机名,networking设置等)的Python脚本,然后执行/etc/init.d/network restart 如果我手动运行rc.local /etc/rc.local一切都很好 系统自动启动时不起作用。 所以触摸命令(第二行 – 工作),但从未执行python脚本,至less它的执行结果(设置主机名和重新启动networking界面似乎根本不工作) 有任何想法吗?

Apache mod_wsgi安装错误

我正在运行CentOS 6.7,我正在尝试安装mod_wsgi( https://code.google.com/p/modwsgi/ ) 通常我会这样做: yum安装mod_wsgi 但是因为我需要确保它在Python 2.7下编译(而不是CentOS默认的Python 2.6版本),所以我决定下载repo( https://github.com/GrahamDumpleton/mod_wsgi/releases )并确保它已经configuration我的场景。 为了安装,我遵循了办公指南: https : //code.google.com/p/modwsgi/wiki/QuickInstallationGuide 唯一的区别是我改变了Python版本: ./configure –with-python=/usr/local/bin/python2.7 以上回报: checking for apxs2… no checking for apxs… no checking for gcc… gcc checking whether the C compiler works… yes checking for C compiler default output file name… a.out checking for suffix of executables… checking whether we […]

Nginx的uWSGI响应被截断

我试图在http://dont-tread-on-memes.controversial.io上写一个networking服务作为一个笑话。 这是一个烧瓶应用程序,提供相当大的图像。 Flask应用程序可以独立运行,就像一个独立的uWSGI服务器一样,但是当我尝试通过uwsgi_pass将uWSGI插入到NGINX中时,突然间所有其他的请求在浏览器中被截断为9.99KB。 阅读与proxy_pass类似的截断之后,我试过: 在我的configuration文件中设置uwsgi_buffering off 使用uwsgi_buffers 1024 1024k; uwsgi_buffer_size 1024k;将缓冲区大小1024k uwsgi_buffers 1024 1024k; uwsgi_buffer_size 1024k; uwsgi_buffers 1024 1024k; uwsgi_buffer_size 1024k; sendfile: off 检查缓冲区文件权限( /var/lib/uwsgi中的所有文件都由www-data用户和www-data组拥有,所以我认为我的权限很好。) 我留下了我目前的configuration,这仍然performance出这个问题: server { listen 80; server_name dont-tread-on-memes.controversial.io; location / { include uwsgi_params; uwsgi_pass unix:/var/www/dont-tread-on-memes/dont_tread_on_memes.sock; uwsgi_buffers 1024 1024k; uwsgi_buffer_size 1024k; } } 最奇怪的部分是,这个问题只出现在第二个请求。 它必须与NGINXcaching有关,因为我没有使用多个NGINX实例或任何东西。 然而它必须与我的NGINXconfiguration有关,因为uWSGI自己运行不会出现问题。 有什么想法可能导致这个问题,以及如何解决它?

Django,wsgi,py。 有什么不同?

我试图让我的cPanel系统上运行一个django应用程序。 我已经安装了mod_wsgi,并按照指南在这里: http : //www.nerdydork.com/setting-up-django-on-a-whm-cpanel-vps-liquidweb.html 然而,我现在感到困惑,因为我不知道下一步该怎么做。 该应用程序有.py文件,我可以通过这个来运行它:python manage.py runserver 211.144.131.148:8000 但是,这是通过命令行并绑定到端口8000.我想用Apache来代替。 问题是,该教程没有进一步深入到如何让Apache来识别.py文件,并运行应用程序,我想它。 接下来我该做什么?

nginx可以循环到不同的端口上的服务器列表吗?

我想在nginx中映射一个特定的域,然后让nginx循环访问将响应http请求的服务器列表。 所以我有nginx www.domain1.com 它是一个Python应用程序,我有10个粘贴运行在不同的端口上的实例,我希望nginx转发/代理请求使用循环。 它可以做到这一点,如果是的话,怎么样?

尝试在Ubuntu Lucid Lynx上启动Apache2 mod_wsgi而无法成功运行Django

我有一个最小安装ubuntu lucid-lynx与约256MB内存的小vps ,它是新安装的没有什么特别的运行。 我试图部署django到它,而我成功地运行服务器使用manage.py,我不能得到Apache与wsgi工作: # service apache2 start && service apache2 status * Starting web server apache2 [ OK ] Apache is NOT running. Erorr日志/var/log/apache2/error.log : [Thu Apr 14 21:17:29 2011] [warn] pid file /var/run/apache2.pid overwritten — Unclean shutdown of previous Apache run? [Thu Apr 14 21:17:29 2011] [notice] Apache/2.2.14 (Ubuntu) mod_wsgi/2.8 Python/2.6.5 configured — […]

pycurl安装寻找一个不存在的文件(libcurl.a)

我正在运行一个Gentoo Linux系统,在这个系统下,我从来没有遇到过使用pip在我的virtualenv中安装任何东西的问题。 我pipe理安装PIL和Django,但出于某种原因, pycurl ( pycurl的依赖)正在翻转,声称我没有libcurl.a (注意它不是.la )在我的系统上。 curl被安装。 事实上,pycurl安装在主机系统上很好,但它不会安装到我的virtualenv。 这是输出: $ pip install cloudkey Requirement already satisfied (use –upgrade to upgrade): cloudkey in /path/to/virtualenv/lib/python2.6/site-packages Requirement already satisfied (use –upgrade to upgrade): distribute in /path/to/virtualenv/lib/python2.6/site-packages (from cloudkey) Requirement already satisfied (use –upgrade to upgrade): simplejson>=2.0.9 in /path/to/virtualenv/lib/python2.6/site-packages (from cloudkey) Downloading/unpacking pycurl>=7.19.0 (from cloudkey) Downloading pycurl-7.19.0.tar.gz […]

在Amazon AWS上处理升级libevent的问题

我正在Amazon EC2上构build一个具有以下依赖关系链的应用程序(使用Python): gevent-websocket —> gevent —> libevent 最后一个(libevent)在星期天升级了,我的服务器现在产生这个错误: (…) File "/usr/lib/python2.6/site-packages/gevent-0.13.7-py2.6-linux-x86_64.egg/gevent/__init__.py", line 41, in <module> from gevent import core ImportError: libevent-1.4.so.2: cannot open shared object file: No such file or directory 不想花太多时间在这个问题上,我试图通过创build一个符号链接到一个总是最近的版本来缓解它: $ sudo ln -s /usr/lib64/libevent.so /usr/lib64/libevent-1.4.so.2 但是这并不奏效: (…) File "/usr/lib/python2.6/site-packages/gevent-0.13.7-py2.6-linux-x86_64.egg/gevent/__init__.py", line 41, in <module> from gevent import core ImportError: /usr/lib/python2.6/site-packages/gevent-0.13.7-py2.6-linux-x86_64.egg/gevent/core.so: undefined symbol: current_base […]