无法在Cygwin上安装uwsgi [英] Can't install uwsgi on cygwin

查看:74
本文介绍了无法在Cygwin上安装uwsgi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的主要操作系统是Windows 10,但我使用cygwin作为终端.通过 pip3 install uwsgi 命令安装uwsgi时,它失败,并显示错误消息"AttributeError:模块'os'没有属性'uname'"

My main OS is windows 10 but I am using cygwin as a terminal. While installing uwsgi through pip3 install uwsgi command , it fails with an error message " AttributeError: module 'os' has no attribute 'uname'"

推荐答案

uWSGI需要使用c编译器来构建,并且要使用platform.uname的os.uname需要在uwsgiconfig.py文件中进行更新.

uWSGI needs a c compiler to build and the os.uname to use platform.uname needs to be updated in the uwsgiconfig.py file.

以下是针对Windows 10的修复方法:

Here is how to fix for windows 10:

  1. cd到uwsgi安装目录并打开uwsgiconfig.py

  1. cd to uwsgi install directory and open uwsgiconfig.py

用以下代码行将os.uname替换为platform.uname:

replace os.uname with platform.uname for the following lines of code:

uwsgi_os = os.uname ()[0]uwsgi_os_k = re.split('[-+ _]', os.uname ()[2])[0]uwsgi_os_v = os.uname ()[3]uwsgi_cpu = os.uname ()[4]

uwsgi_os = os.uname()[0] uwsgi_os_k = re.split('[-+_]', os.uname()[2])[0] uwsgi_os_v = os.uname()[3] uwsgi_cpu = os.uname()[4]

对此:

uwsgi_os = **platform.uname**()[0]
uwsgi_os_k = re.split('[-+_]', **platform.uname**()[2])[0]
uwsgi_os_v = **platform.uname**()[3]
uwsgi_cpu = **platform.uname**()[4]

  1. 使用cygwin安装以下软件包,以确保您具有适用于cygwin终端的python3和gcc,而不仅仅是Windows上安装的python.这是Windows之外的单独python安装.

  1. Install the following packages with cygwin to make sure you have python3 and gcc available for cygwin terminal and not just python installed on windows. This is a separate python install than for windows itself.

  • 打开Windows cmd终端
  • 将CD转换为cygwin64(或您的安装目录)
  • 运行以下命令:setup-x86_64.exe -q -P wget -P gcc-g ++ -P gcc-core -P gcc-g ++ -P libcrypt-devel -P libintl-devel -P python3 -P python3-devel

  • Open windows cmd terminal
  • cd to cygwin64 (or your install dir)
  • run this command: setup-x86_64.exe -q -P wget -P gcc-g++ -P gcc-core -P gcc-g++ -P libcrypt-devel -P libintl-devel -P python3 -P python3-devel

此命令应为Cygwin64安装以下软件包:gcc核心gcc-g ++libcrypt开发libintl-开发python3python3-devel

This command should install the following packages for Cygwin64: gcc-core gcc-g++ libcrypt-devel libintl-devel python3 python3-devel

  1. 在Cygwin终端窗口中

  • cd到uwsgi目录
  • 键入并运行命令"python3 setup.py install"
  • 等待这一切完成,然后跳个开心的舞.
  • 这篇关于无法在Cygwin上安装uwsgi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆