且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法在Cygwin上安装uwsgi

更新时间:2023-12-04 08:11:04

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"
  • 等待这一切完成,然后跳个开心的舞.