编译失败,/tmp/pip_build_root/uwsgi 中的错误代码为 1 [英] Compile failed with error code 1 in /tmp/pip_build_root/uwsgi
问题描述
我正在尝试遵循 http://uwsgi 上的教程-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html.我已经把一切都搞定了 http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html#install-uwsgi-system-wide.我正在亚马逊 EC2 上使用 ubuntu 14.4 实例:
没有进入我的 virtualenv ,我跑了:
sudo pip install uwsgi
这导致:
----------------------------------------打扫干净...命令/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record/tmp/pip-64P2dl-record/install-record.txt --single-version-externally-managed --compile 失败,错误代码 1 在/tmp/pip_build_root/uwsgi在/home/ubuntu/.pip/pip.log 中存储失败的调试日志
日志有:
清理...正在删除临时目录/tmp/pip_build_ubuntu...命令/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-uLEPHb-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record/tmp/pip-hPh8D0-record/install-record.txt --single-version-externally-managed --compile 失败,错误代码 1 在/tmp/pip-uLEPHb-build异常信息:回溯(最近一次调用最后一次):文件/usr/lib/python2.7/dist-packages/pip/basecommand.py",第 122 行,在主目录中status = self.run(options, args)运行中的文件/usr/lib/python2.7/dist-packages/pip/commands/install.py",第 283 行required_set.install(install_options, global_options, root=options.root_path)安装中的文件/usr/lib/python2.7/dist-packages/pip/req.py",第 1435 行required.install(install_options, global_options, *args, **kwargs)文件/usr/lib/python2.7/dist-packages/pip/req.py",第706行,安装cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)文件/usr/lib/python2.7/dist-packages/pip/util.py",第 697 行,在 call_subprocess% (command_desc, proc.returncode, cwd))安装错误:命令/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-uLEPHb-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record/tmp/pip-hPh8D0-record/install-record.txt --single-version-externally-managed --compile 失败,错误代码 1 在/tmp/pip-uLEPHb-build
我做错了什么?
回答你的问题可能有点晚,但我的回答可以帮助以后的人.
我向后看日志,看到了这些行.
<前>[x86_64-linux-gnu-gcc -插件/python/python_plugin.c:1:0中包含的文件:plugins/python/uwsgi_python.h:2:20: 致命错误: Python.h: 没有那个文件或目录#包括^编译终止.结果是找不到Python.h.安装 python2.7-dev 为我解决了这个问题.
<前>apt-get install -y python2.7-devI'm trying to follow the tutorial at http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html. I've gotten everything working down tohttp://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html#install-uwsgi-system-wide. I am working with an ubuntu 14.4 instance on amazon EC2:
Without going into my virtualenv , I ran:
sudo pip install uwsgi
This led to :
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-64P2dl-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/uwsgi
Storing debug log for failure in /home/ubuntu/.pip/pip.log
The log has:
Cleaning up...
Removing temporary dir /tmp/pip_build_ubuntu...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-uLEPHb-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hPh8D0-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-uLEPHb-build
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-uLEPHb-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hPh8D0-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-uLEPHb-build
What am I doing wrong?
May be a little late to answer your question but putting my answer could help people later.
I looked backward at the log and saw these lines.
[x86_64-linux-gnu-gcc -In file included from plugins/python/python_plugin.c:1:0: plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory #include ^ compilation terminated.
It turned out that it couldn't find Python.h. Installing python2.7-dev fixed the problem for me.
apt-get install -y python2.7-dev
这篇关于编译失败,/tmp/pip_build_root/uwsgi 中的错误代码为 1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!