pip install uwsgi gives Error : AttributeError: module 'os' has no attribute 'uname'
pip install uwsgi gives Error : AttributeError: module 'os' has no attribute 'uname'
系统:Windows10
Python : 3.9.5
我正在学习在 Google 云上部署 Flask 应用程序。
我正在尝试安装 uwsgi(在我的 windows 系统上),如 this youtube video.
所示
pip install uwsgi
这个错误来了
(flask) D:\projects\websites\googleHostFlaskApp>pip install uwsgi
Collecting uwsgi
Using cached uWSGI-2.0.19.1.tar.gz (803 kB)
ERROR: Command errored out with exit status 1:
command: 'd:\projects\websites\googlehostflaskapp\env\scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\setup.py'"'"'; __file__='"'"'C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\HP\AppData\Local\Temp\pip-pip-egg-info-tiy5mnl9'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\setup.py", line 3, in <module>
import uwsgiconfig as uc
File "C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\uwsgiconfig.py", line 8, in <module>
uwsgi_os = os.uname()[0]
pi
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c7/75/45234f7b441c59b1eefd31ba3d1041a7e3c89602af24488e2a22e11e7259/uWSGI-2.0.19.1.tar.gz#sha256=faa85e053c0b1be4d5585b0858d3a511d2cd10201802e8676060fd0a109e5869 (from https://pypi.org/simple/uwsgi/). Command errored
out with exit status 1: python setup.py egg_info Check the logs for full command output.
我试过的答案:
For windows : 我不确定我们必须将答案中给出的文件放在哪里?
For ubuntu : I get that i have to add some development library to python, but not able to find the correct one here 将其安装到我的 windows 系统中。
要在 Windows 上安装 uWSGI ,你需要 Cygwin。
注意您需要安装所有依赖项,检查您的 Cygwin 是否包含 Devel
类别和 python3.6-devel
包。
安装Cygwin后,从https://uwsgi-docs.readthedocs.io/en/latest/Download.html
下载稳定版uWSGI
将稳定版文件解压到任何你想要的文件夹(例如/user/Desktop/usgwi/
),然后打开Cygwin终端并重定向到uwsgi文件夹。在这种情况下,我们使用 cd /user/Desktop/usgwi/uwsgi-2.0.19
。 *注意使用自己的路径,并检查文件夹名称。
进入目录后,运行 python3 setup.py install
安装后 运行 uwsgi --version
进行快速检查。
您需要的其余信息都在官方文档中。
安装 UWSGI 不是一件容易的事。 @Seraph 的回答确实有帮助,但他遗漏了一些要点,我最终安装了 UWSGI。
所以这是完整的步骤,这样您就不必像我一样在这上面浪费一天的时间了:
安装 Cygwindownload
(Cygwin 是一个开源工具集合,允许在 Linux 操作系统中编译 Unix 或 Linux 应用程序和 运行 -like 界面).
This youtube link 将在您下载 Cygwin 的过程中为您提供帮助。
在 cygwin 中你需要的包:
gcc-核心
gcc-g++
libintl-devel
python3-发展
python38-开发
gettext-开发
(如果它给出错误 需要 c 编译器,那么 gcc-core 会有所帮助,如果错误:-lintl missing,那么 libintl-devel 有帮助)
3.After你打开Cygwin应用程序,你可以按照上面的youtube link,在你的Windows系统上成功运行 uwsgi。
系统:Windows10
Python : 3.9.5
我正在学习在 Google 云上部署 Flask 应用程序。
我正在尝试安装 uwsgi(在我的 windows 系统上),如 this youtube video.
pip install uwsgi
这个错误来了
(flask) D:\projects\websites\googleHostFlaskApp>pip install uwsgi
Collecting uwsgi
Using cached uWSGI-2.0.19.1.tar.gz (803 kB)
ERROR: Command errored out with exit status 1:
command: 'd:\projects\websites\googlehostflaskapp\env\scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\setup.py'"'"'; __file__='"'"'C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\HP\AppData\Local\Temp\pip-pip-egg-info-tiy5mnl9'
cwd: C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\setup.py", line 3, in <module>
import uwsgiconfig as uc
File "C:\Users\HP\AppData\Local\Temp\pip-install-93528com\uwsgi_9bf2ba795b9549d6a9a0d2dfa78cd774\uwsgiconfig.py", line 8, in <module>
uwsgi_os = os.uname()[0]
pi
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c7/75/45234f7b441c59b1eefd31ba3d1041a7e3c89602af24488e2a22e11e7259/uWSGI-2.0.19.1.tar.gz#sha256=faa85e053c0b1be4d5585b0858d3a511d2cd10201802e8676060fd0a109e5869 (from https://pypi.org/simple/uwsgi/). Command errored
out with exit status 1: python setup.py egg_info Check the logs for full command output.
我试过的答案:
For windows : 我不确定我们必须将答案中给出的文件放在哪里?
For ubuntu : I get that i have to add some development library to python, but not able to find the correct one here 将其安装到我的 windows 系统中。
要在 Windows 上安装 uWSGI ,你需要 Cygwin。
注意您需要安装所有依赖项,检查您的 Cygwin 是否包含 Devel
类别和 python3.6-devel
包。
安装Cygwin后,从https://uwsgi-docs.readthedocs.io/en/latest/Download.html
下载稳定版uWSGI将稳定版文件解压到任何你想要的文件夹(例如/user/Desktop/usgwi/
),然后打开Cygwin终端并重定向到uwsgi文件夹。在这种情况下,我们使用 cd /user/Desktop/usgwi/uwsgi-2.0.19
。 *注意使用自己的路径,并检查文件夹名称。
进入目录后,运行 python3 setup.py install
安装后 运行 uwsgi --version
进行快速检查。
您需要的其余信息都在官方文档中。
安装 UWSGI 不是一件容易的事。 @Seraph 的回答确实有帮助,但他遗漏了一些要点,我最终安装了 UWSGI。
所以这是完整的步骤,这样您就不必像我一样在这上面浪费一天的时间了:
安装 Cygwindownload
(Cygwin 是一个开源工具集合,允许在 Linux 操作系统中编译 Unix 或 Linux 应用程序和 运行 -like 界面).
This youtube link 将在您下载 Cygwin 的过程中为您提供帮助。在 cygwin 中你需要的包:
gcc-核心
gcc-g++
libintl-devel
python3-发展
python38-开发
gettext-开发
(如果它给出错误 需要 c 编译器,那么 gcc-core 会有所帮助,如果错误:-lintl missing,那么 libintl-devel 有帮助)
3.After你打开Cygwin应用程序,你可以按照上面的youtube link,在你的Windows系统上成功运行 uwsgi。