pip安装django-iprestrict[geoip] 报错:error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

本文主要是介绍pip安装django-iprestrict[geoip] 报错:error: command 'x86_64-linux-gnu-gcc' failed with exit status 1,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

使用pip安装django-iprestrict[geoip]:

➜  ~ sudo pip3 install django-iprestrict\[geoip\]
...此处省略好多行Running setup.py bdist_wheel for GeoIP ... errorComplete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ur8tctju/GeoIP/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp798t3yhtpip-wheel- --python-tag cp35:/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'warnings.warn(msg)running bdist_wheelrunning buildrunning build_extbuilding 'GeoIP' extensioncreating buildcreating build/temp.linux-x86_64-3.5x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c py_GeoIP.c -o build/temp.linux-x86_64-3.5/py_GeoIP.opy_GeoIP.c:23:19: fatal error: GeoIP.h: 没有那个文件或目录compilation terminated.error: command 'x86_64-linux-gnu-gcc' failed with exit status 1----------------------------------------Failed building wheel for GeoIPRunning setup.py clean for GeoIPRunning setup.py bdist_wheel for maxminddb ... doneStored in directory: /home/lss/.cache/pip/wheels/15/76/41/255dfba221c2556c5e45dcf0d832ee63ea83dd151dada50b0f
Successfully built django-templatetag-handlebars pycountry maxminddb
Failed to build GeoIP
Installing collected packages: pytz, Django, django-templatetag-handlebars, pycountry, GeoIP, maxminddb, certifi, urllib3, idna, chardet, requests, geoip2, django-iprestrictRunning setup.py install for GeoIP ... errorComplete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ur8tctju/GeoIP/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-z4edljlo-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'warnings.warn(msg)running installrunning buildrunning build_extbuilding 'GeoIP' extensioncreating buildcreating build/temp.linux-x86_64-3.5x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c py_GeoIP.c -o build/temp.linux-x86_64-3.5/py_GeoIP.opy_GeoIP.c:23:19: fatal error: GeoIP.h: 没有那个文件或目录compilation terminated.error: command 'x86_64-linux-gnu-gcc' failed with exit status 1----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ur8tctju/GeoIP/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-z4edljlo-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-ur8tctju/GeoIP/

看报错信息发现应该是GeoIP这个包的问题,单独运行:

➜  ~ sudo pip3 install GeoIP
The directory '/home/lss/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/lss/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting GeoIPDownloading https://files.pythonhosted.org/packages/f2/7b/a463b7c3df8ef4b9c92906da29ddc9e464d4045f00c475ad31cdb9a97aae/GeoIP-1.3.2.tar.gz
Installing collected packages: GeoIPRunning setup.py install for GeoIP ... errorComplete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-o6bh_yap/GeoIP/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1ryyzr40-record/install-record.txt --single-version-externally-managed --compile:/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'bugtrack_url'warnings.warn(msg)running installrunning buildrunning build_extbuilding 'GeoIP' extensioncreating buildcreating build/temp.linux-x86_64-3.5x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c py_GeoIP.c -o build/temp.linux-x86_64-3.5/py_GeoIP.opy_GeoIP.c:23:19: fatal error: GeoIP.h: 没有那个文件或目录compilation terminated.error: command 'x86_64-linux-gnu-gcc' failed with exit status 1----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-o6bh_yap/GeoIP/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1ryyzr40-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-o6bh_yap/GeoIP/

果然报错,网上搜索类似好多这个报错信息的问题发现应该是缺少某个依赖包,不过还没有找到应该是什么包…
未完待续…

这篇关于pip安装django-iprestrict[geoip] 报错:error: command 'x86_64-linux-gnu-gcc' failed with exit status 1的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/707673

相关文章

linux hostname设置全过程

《linuxhostname设置全过程》:本文主要介绍linuxhostname设置全过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录查询hostname设置步骤其它相关点hostid/etc/hostsEDChina编程A工具license破解注意事项总结以RHE

Linux中压缩、网络传输与系统监控工具的使用完整指南

《Linux中压缩、网络传输与系统监控工具的使用完整指南》在Linux系统管理中,压缩与传输工具是数据备份和远程协作的桥梁,而系统监控工具则是保障服务器稳定运行的眼睛,下面小编就来和大家详细介绍一下它... 目录引言一、压缩与解压:数据存储与传输的优化核心1. zip/unzip:通用压缩格式的便捷操作2.

Python中win32包的安装及常见用途介绍

《Python中win32包的安装及常见用途介绍》在Windows环境下,PythonWin32模块通常随Python安装包一起安装,:本文主要介绍Python中win32包的安装及常见用途的相关... 目录前言主要组件安装方法常见用途1. 操作Windows注册表2. 操作Windows服务3. 窗口操作

Linux中SSH服务配置的全面指南

《Linux中SSH服务配置的全面指南》作为网络安全工程师,SSH(SecureShell)服务的安全配置是我们日常工作中不可忽视的重要环节,本文将从基础配置到高级安全加固,全面解析SSH服务的各项参... 目录概述基础配置详解端口与监听设置主机密钥配置认证机制强化禁用密码认证禁止root直接登录实现双因素

在Linux终端中统计非二进制文件行数的实现方法

《在Linux终端中统计非二进制文件行数的实现方法》在Linux系统中,有时需要统计非二进制文件(如CSV、TXT文件)的行数,而不希望手动打开文件进行查看,例如,在处理大型日志文件、数据文件时,了解... 目录在linux终端中统计非二进制文件的行数技术背景实现步骤1. 使用wc命令2. 使用grep命令

Linux如何快速检查服务器的硬件配置和性能指标

《Linux如何快速检查服务器的硬件配置和性能指标》在运维和开发工作中,我们经常需要快速检查Linux服务器的硬件配置和性能指标,本文将以CentOS为例,介绍如何通过命令行快速获取这些关键信息,... 目录引言一、查询CPU核心数编程(几C?)1. 使用 nproc(最简单)2. 使用 lscpu(详细信

linux重启命令有哪些? 7个实用的Linux系统重启命令汇总

《linux重启命令有哪些?7个实用的Linux系统重启命令汇总》Linux系统提供了多种重启命令,常用的包括shutdown-r、reboot、init6等,不同命令适用于不同场景,本文将详细... 在管理和维护 linux 服务器时,完成系统更新、故障排查或日常维护后,重启系统往往是必不可少的步骤。本文

k8s上运行的mysql、mariadb数据库的备份记录(支持x86和arm两种架构)

《k8s上运行的mysql、mariadb数据库的备份记录(支持x86和arm两种架构)》本文记录在K8s上运行的MySQL/MariaDB备份方案,通过工具容器执行mysqldump,结合定时任务实... 目录前言一、获取需要备份的数据库的信息二、备份步骤1.准备工作(X86)1.准备工作(arm)2.手

基于Linux的ffmpeg python的关键帧抽取

《基于Linux的ffmpegpython的关键帧抽取》本文主要介绍了基于Linux的ffmpegpython的关键帧抽取,实现以按帧或时间间隔抽取关键帧,文中通过示例代码介绍的非常详细,对大家的学... 目录1.FFmpeg的环境配置1) 创建一个虚拟环境envjavascript2) ffmpeg-py

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的