当前位置: 首页 > 面试题库 >

在uwsgi上切换python版本

山寒
2023-03-14
问题内容

我正在用nginx和uwsgi运行django应用程序。一切正常,但突然之间我不知道自己更改了应用程序停止工作了。

问题在于uWsgi的python版本是2.4.3,这是Linux
CentOs中的默认版本,我已经在2.7.3版中安装了django,webpy和其他python发行版(将尽快升级)。

我还尝试在usr / bin中创建从python 2.7路径到“ python”的符号链接,但不起作用。

如何使uWsgi使用python2.7.3(/ usr / local / bin /)代替2.4.3?

Django ini:

socket = 127.0.0.1:3031
master = true
processes = 4
env = DJANGO_SETTINGS_MODULE=djtest.settings
module = django.core.handlers.wsgi:WSGIHandler()

当我初始化

./uwsgi --ini django.ini
[uWSGI] getting INI configuration from django.ini
*** Starting uWSGI 1.3 (64bit) on [Sat Nov 24 00:27:55 2012] ***
compiled with version: 4.1.2 20080704 (Red Hat 4.1.2-52) on 23 November 2012 22:37:39
os: Linux-2.6.18-194.17.4.el5xen #1 SMP Mon Oct 25 16:36:31 EDT 2010
nodename: v238545.hostingator.net
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /root
detected binary path: /opt/uwsgi/uwsgi
your processes number limit is 32832
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uWSGI http bound on :8000 fd 4
spawned uWSGI http 1 (pid: 5841)
uwsgi socket 0 bound to TCP address 127.0.0.1:59395 (port auto-assigned) fd 3
Python version: 2.4.3 (#1, Jun 18 2012, 08:55:23)  [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1cc1130
your server socket listen backlog is limited to 100 connections
mapped 72352 bytes (70 KB) for 1 cores
*** Operational MODE: single process ***
added /usr/local/bin/ to pythonpath.
added /home/indaxone/serv/ to pythonpath.
ImportError: No module named django.core.handlers.wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 5840, cores: 1)

问题答案:

在uwsgi安装过程中执行“ make”之前,我做了以下工作:

python2.7 uwsgiconfig.py --build


 类似资料:
  • 问题内容: 故事:我拥有的其中一个应用程序可以在python 2.4上工作,而另一个可以在2.6上工作。我试图将python2.4链接到python,并且在ubuntu麻烦时事情开始崩溃。现在我正在下载2.4的每个依赖项,并使用python2.4 setup.py install进行安装。依赖性似乎是无限的。 问题1:我将如何告诉任何要使用版本的框架,例如pf python,如day django

  • 我尝试了几种方法将mac上的JDK版本从13.0.2切换到14.0.1,但都失败了。首先我打了 导出java_home=$(/usr/libexec/java_home-v 14.0.1) 在bash文件中,并在一个新的终端中键入 java版本 当我键入时编辑 它返回哪个java:

  • 我正在使用python版本3.10.2,但是我想降级到3.9,因为它与我项目中的库不兼容。我怎样才能用终端命令做到这一点? 因此,当我键入<code>python3——版本</code>时,我的版本是3.10.2,我想将其降级。IDE是pycharm

  • 我需要切换上的Java版本,但不确定如何切换,我现在的版本是但我想切换到: 我想我的Mac上没有这样的版本吧?怎样才能安装它,然后再切换到它呢?谢谢!

  • update to revision:更新到指定版本。