python2.7安装和uwsgi

python2.7安装和uwsgi

tar zxf Python-2.7.13xxxx# 这里,必须用–enable-shared,生成动态库,否则会遇到wsgi不能编译的问题。

Bonus: multiple Python versions for the same uWSGI binary

As we have seen, uWSGI is composed of a small core and various plugins. Plugins can be embedded in the binary or loaded dynamically. When you build uWSGI for Python, a series of plugins plus the Python one are embedded in the final binary.

This could be a problem if you want to support multiple Python versions without building a binary for each one.

The best approach would be having a little binary with the language-independent features built in, and one plugin for each Python version that will be loaded on-demand.

In the uWSGI source directory:

make PROFILE=nolang

This will build a uwsgi binary with all the default plugins built-in except the Python one.

Now, from the same directory, we start building Python plugins:

PYTHON=python3.4 ./uwsgi --build-plugin "plugins/python python34"
PYTHON=python2.7 ./uwsgi --build-plugin "plugins/python python27"
PYTHON=python2.6 ./uwsgi --build-plugin "plugins/python python26"

You will end up with three files: python34_plugin.so, python27_plugin.so, python26_plugin.so. Copy these into your desired directory. (By default, uWSGI searches for plugins in the current working directory.)

Now in your configurations files you can simply add (at the very top) the plugins-dir and plugin directives.

[uwsgi]
plugins-dir = <path_to_your_plugin_directory>
plugin = python26

This will load the python26_plugin.so plugin library from the directory into which you copied the plugins.

时间: 2024-08-27 00:59:30

python2.7安装和uwsgi的相关文章

云服务器的python2.7安装

2. 安装python2.7 机器自带python2.4.3版本:但是,很多新功能都是基于2.7来的:比如多进程.装饰器等: 于是,需要自己准备python环境了: python环境准备: wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz tar zxf Python-2.7.3.tgz cd Python-2.7.3 ./configure --prefix=/usr/local/python27 make make in

python2.7安装numpy报错:is not a supported wheel on...

python2.7安装numpy时报错信息如下: C:\Python27\Scripts>pip install "numpy-1.9.2+mkl-cp26-none-win_amd64.whl" numpy-1.9.2+mkl-cp26-none-win_amd64.whl is not a supported wheel on this platfor m. 错误原因: 事实上是因为,我的python为2.7版本,下载的numpy为2.6版本,所以错误. 解决方案: 参见:f

ubuntu Python2.7 安装PIL问题

$sudo easy_install PIL WARNING: '' not a valid package name; please use only.-separated package names in setup.py _imaging.c:75:20: fatal error: Python.h: 没有那个文件或目录 #include "Python.h" ^ compilation terminated. error: Setup script exited with er

python2.7安装etuptools-36.6.0报ascii&#39; codec can&#39;t decode byte 0xce in position 7问题

解决办法1: 原文链接:http://blog.csdn.net/all_over_servlet/article/details/45112221 修改编码为gbk,修改D:\Python27\Lib\ntpath.py(位置由个人python安装目录决定)文件中的def join(path, *paths)函数,在函数内第一行加入 reload(sys) sys.setdefaultencoding('gbk') 即: # Join two (or more) paths. def join

centos7下python2环境安装pip2、kazoo、bottle、beaker

摘自:https://mp.weixin.qq.com/s?src=11&timestamp=1576355125&ver=2034&signature=mNp2na6VjFzT9n3FiDC0ICOWiHP4UJnqa1oTvkwEzuc7LPHYEyveSSBfQOq9*kM7vFjS4xB7QNtHYAev9CgCtGC2U0tkVNf0L6hwTGFjhleUT3CkPqu61mlqP-GTdr*4&new=1 一.centos7 下为自带的python2.7安装p

部署(5.安装配置uwsgi)

1.安装配置uwsgi 1.安装uwsgi到真实(非虚拟环境)环境下 #退出虚拟环境 deactivate cd .. apt install python3-pip y apt-get install -y python3-dev pip3 install uwsgi 2.使用uwsgi启动项目 1.运行项目 uwsgi --chdir /home/ubuntu/untitled --home /home/ubuntu/env36 --http :8000 --module untitled.

centos uwsgi自动调用python2环境,指定uwsgi调用版本

将自己开发好的django项目用uwsgi部署到Linux服务器.当运行uwsgi时出现了uwsgi选择python版本的问题.因为本机器是在原来的机器上安装了python3环境和pip3, 使用命令安装uwsgi: pip3 install uwsgi 一点问题也没有,使用uwsgi部署项目时 uwsgi --http :8080 --wsgi-file Preweb/wsgi.py 这里的PreWeb是项目名,发现uwsgi会自动调用centos自带的python2.7.5版本 无奈之下,只

【Python】python2.7 安装配置OpenCV2

环境:Ubuntu16.04 anaconda Python2.7 opencv2.4.13 安装opencv后 import cv2 遇到错误信息: No module named cv2 安装opencv时make的过程中会出现文件"cv2.so",它是连接OpenCV和python的关键文件.错误的原因就在于python找不到我们刚才提到的cv2.so文件 /usr/local/lib/python2.7中发现有两个文件夹,一个是dist-package,一个是site-pack

linux升级python2.7,安装pip,setuptools,zlib

1,在192.168.0.65装python2.7和PIP     #ssh 192.168.0.65         升级到python2.7     #cd /usr/local     #wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz         # tar zxvf Python-2.7.10.tgz     # cd Python-2.7.10     # mkdir /usr/local/Python