python - 无法在 virtualenv 中 pip 安装 uwsgi

标签 python uwsgi

环境:CentOS6.4,python2.6 我创建了一个virtualenv(envflask)并激活它,然后pip install flask,一切正常!但是在创建另一个 virtualenv (envuwsgi) 并激活它之后,我无法 pip install uwsgi,错误消息是:

...
plugins/python/python_plugin.c:1731: 错误:被调用的对象‘<erroneous-expression>’不是一个函数

plugins/python/python_plugin.c:1731: 错误:语句不起作用

plugins/python/python_plugin.c: 在函数‘uwsgi_python_harakiri’中:

plugins/python/python_plugin.c:1737: 错误:‘struct uwsgi_python’没有名为‘tracebacker’的成员

plugins/python/python_plugin.c:1740: 错误:‘struct uwsgi_python’没有名为‘tracebacker’的成员

plugins/python/python_plugin.c:1740: 错误:传递‘uwsgi_concat2’的第 1 个参数时在不兼容的指针类型间转换

plugins/python/../../uwsgi.h:2733: 附注:需要类型‘char *’,但实参的类型为‘struct uwsgi_option *’

plugins/python/python_plugin.c: 在函数‘uwsgi_python_logger’中:

plugins/python/python_plugin.c:1768: 错误:‘struct uwsgi_python’没有名为‘gil_get’的成员

plugins/python/python_plugin.c:1768: 错误:被调用的对象‘<erroneous-expression>’不是一个函数

plugins/python/python_plugin.c:1768: 错误:语句不起作用

plugins/python/python_plugin.c:1771: 错误:‘PyObject’未声明(在此函数内第一次使用)

plugins/python/python_plugin.c:1771: 错误:‘py_logging’未声明(在此函数内第一次使用)

plugins/python/python_plugin.c:1771: 错误:双目运算符 * 操作数(‘struct uwsgi_option *’和‘struct uwsgi_option *’)无效

plugins/python/python_plugin.c:1771: 错误:语句不起作用

plugins/python/python_plugin.c:1773: 错误:‘py_logging_dict’未声明(在此函数内第一次使用)

plugins/python/python_plugin.c:1773: 错误:双目运算符 * 操作数(‘struct uwsgi_option *’和‘struct uwsgi_option *’)无效

plugins/python/python_plugin.c:1773: 错误:语句不起作用

plugins/python/python_plugin.c:1775: 错误:‘py_getLogger’未声明(在此函数内第一次使用)

plugins/python/python_plugin.c:1775: 错误:双目运算符 * 操作数(‘struct uwsgi_option *’和‘struct uwsgi_option *’)无效

plugins/python/python_plugin.c:1775: 错误:语句不起作用

plugins/python/python_plugin.c:1777: 错误:‘py_getLogger_args’未声明(在此函数内第一次使用)

plugins/python/python_plugin.c:1777: 错误:双目运算符 * 操作数(‘struct uwsgi_option *’和‘struct uwsgi_option *’)无效

plugins/python/python_plugin.c:1777: 错误:语句不起作用

plugins/python/python_plugin.c:1779: 错误:语句不起作用

plugins/python/python_plugin.c:1791: 错误:隐式声明函数‘PyObject_CallMethod’

plugins/python/python_plugin.c:1791: 错误:expected expression before ‘)’ token

plugins/python/python_plugin.c:1791: 错误:双目运算符 * 操作数(‘struct uwsgi_option *’和‘struct uwsgi_option *’)无效

plugins/python/python_plugin.c:1795: 错误:‘struct uwsgi_python’没有名为‘gil_release’的成员

plugins/python/python_plugin.c:1795: 错误:被调用的对象‘<erroneous-expression>’不是一个函数

plugins/python/python_plugin.c:1795: 错误:语句不起作用

plugins/python/python_plugin.c:1799: 错误:‘struct uwsgi_python’没有名为‘gil_release’的成员

plugins/python/python_plugin.c:1799: 错误:被调用的对象‘<erroneous-expression>’不是一个函数

plugins/python/python_plugin.c:1799: 错误:语句不起作用

----------------------------------------
Command /home/Alex/myproject/envuwsgi/bin/python -c "import setuptools;__file__='/home/Alex/myproject/envuwsgi/build/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-o9rNHV-record/install-record.txt --single-version-externally-managed --install-headers /home/Alex/myproject/envuwsgi/include/site/python2.6 failed with error code 1 in /home/Alex/myproject/envuwsgi/build/uwsgi
Storing complete log in /home/Alex/.pip/pip.log
(envuwsgi)[Alex@Alex myproject]$ 

谢谢!

最佳答案

你的 python 安装需要头文件,所以像“PyObject”这样的东西可以被 uwsgi python 插件使用。

试试这个:

yum install python-devel

关于python - 无法在 virtualenv 中 pip 安装 uwsgi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16952166/

相关文章:

python - 从具有元组值的字典中选择特定元素

python - vmprof : Example config. ini 文件 : configparser. MissingSectionHeaderError

python - Tinkerpop 和 Python - 通过 gremlin 设置数组属性

python - 如何在 uwsgi 中使用 nginx UWSGI_SETENV 获取 env_vars

django - 未找到 uWSGI 命令

python - jinja - 类型错误 : type Undefined doesn't define __round__ method

python - + : 'int' and 'tuple' 不受支持的操作数类型

python - 通过 SSL 运行时无法解析 Flask 中的请求数据

python - POST 处理程序返回的页面被忽略 - 得到空白响应 (web.py)

python:从 uwsgi 迁移到 http-socket