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

相关文章

Win11安装PostgreSQL数据库的两种方式详细步骤

《Win11安装PostgreSQL数据库的两种方式详细步骤》PostgreSQL是备受业界青睐的关系型数据库,尤其是在地理空间和移动领域,:本文主要介绍Win11安装PostgreSQL数据库的... 目录一、exe文件安装 (推荐)下载安装包1. 选择操作系统2. 跳转到EDB(PostgreSQL 的

Linux换行符的使用方法详解

《Linux换行符的使用方法详解》本文介绍了Linux中常用的换行符LF及其在文件中的表示,展示了如何使用sed命令替换换行符,并列举了与换行符处理相关的Linux命令,通过代码讲解的非常详细,需要的... 目录简介检测文件中的换行符使用 cat -A 查看换行符使用 od -c 检查字符换行符格式转换将

Linux系统配置NAT网络模式的详细步骤(附图文)

《Linux系统配置NAT网络模式的详细步骤(附图文)》本文详细指导如何在VMware环境下配置NAT网络模式,包括设置主机和虚拟机的IP地址、网关,以及针对Linux和Windows系统的具体步骤,... 目录一、配置NAT网络模式二、设置虚拟机交换机网关2.1 打开虚拟机2.2 管理员授权2.3 设置子

Linux系统中卸载与安装JDK的详细教程

《Linux系统中卸载与安装JDK的详细教程》本文详细介绍了如何在Linux系统中通过Xshell和Xftp工具连接与传输文件,然后进行JDK的安装与卸载,安装步骤包括连接Linux、传输JDK安装包... 目录1、卸载1.1 linux删除自带的JDK1.2 Linux上卸载自己安装的JDK2、安装2.1

Linux卸载自带jdk并安装新jdk版本的图文教程

《Linux卸载自带jdk并安装新jdk版本的图文教程》在Linux系统中,有时需要卸载预装的OpenJDK并安装特定版本的JDK,例如JDK1.8,所以本文给大家详细介绍了Linux卸载自带jdk并... 目录Ⅰ、卸载自带jdkⅡ、安装新版jdkⅠ、卸载自带jdk1、输入命令查看旧jdkrpm -qa

Linux samba共享慢的原因及解决方案

《Linuxsamba共享慢的原因及解决方案》:本文主要介绍Linuxsamba共享慢的原因及解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux samba共享慢原因及解决问题表现原因解决办法总结Linandroidux samba共享慢原因及解决

mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法

《mysql出现ERROR2003(HY000):Can‘tconnecttoMySQLserveron‘localhost‘(10061)的解决方法》本文主要介绍了mysql出现... 目录前言:第一步:第二步:第三步:总结:前言:当你想通过命令窗口想打开mysql时候发现提http://www.cpp

MySQL Workbench 安装教程(保姆级)

《MySQLWorkbench安装教程(保姆级)》MySQLWorkbench是一款强大的数据库设计和管理工具,本文主要介绍了MySQLWorkbench安装教程,文中通过图文介绍的非常详细,对大... 目录前言:详细步骤:一、检查安装的数据库版本二、在官网下载对应的mysql Workbench版本,要是

新特性抢先看! Ubuntu 25.04 Beta 发布:Linux 6.14 内核

《新特性抢先看!Ubuntu25.04Beta发布:Linux6.14内核》Canonical公司近日发布了Ubuntu25.04Beta版,这一版本被赋予了一个活泼的代号——“Plu... Canonical 昨日(3 月 27 日)放出了 Beta 版 Ubuntu 25.04 系统镜像,代号“Pluc

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu