摘要:在使用安装库时出现以下错误在网上搜了很久,仅发现针对的解决方案。在一番研究后,发现的故意删除了。可以看到文件夹被恢复了。在这之后再执行结果显示苹果的更新去除了,导致找不到文件,从而阻止了库的安装。
Environment: macOS mojave - 10.14.1; python 2.7.15/python 3.7.1.
在使用pip安装Twisted库时出现以下错误:
In file included from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/7.1.0/include-fixed/syslimits.h:7:0, from /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/7.1.0/include-fixed/limits.h:34, from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:19, from src/twisted/test/raiser.c:4: /usr/local/lib/gcc/x86_64-apple-darwin15.6.0/7.1.0/include-fixed/limits.h:194:15: fatal error: limits.h: No such file or directory #include_next/* recurse down to the real one */ ^~~~~~~~~~ compilation terminated. error: Setup script exited with error: command "gcc" failed with exit status 1
在网上搜了很久,仅发现针对linux的解决方案。没有人提到macOS。
在一番研究后,发现macOS mojave的update故意删除了/user/include。于是想到是否因为/usr/include不存在了,所以pip找不到limit.h了呢。
于是执行了下面这行命令,重新手动恢复/usr/include文件夹。
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
可以看到/usr/include文件夹被恢复了。
在这之后再执行
pip install Twisted
结果显示successfully installed:
Collecting twisted Using cached https://files.pythonhosted.org/packages/5d/0e/a72d85a55761c2c3ff1cb968143a2fd5f360220779ed90e0fadf4106d4f2/Twisted-18.9.0.tar.bz2 Requirement already satisfied: zope.interface>=4.4.2 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from twisted) (4.6.0) Requirement already satisfied: constantly>=15.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from twisted) (15.1.0) Requirement already satisfied: incremental>=16.10.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from twisted) (17.5.0) Requirement already satisfied: Automat>=0.3.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from twisted) (0.7.0) Requirement already satisfied: hyperlink>=17.1.1 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from twisted) (18.0.0) Requirement already satisfied: PyHamcrest>=1.9.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from twisted) (1.9.0) Requirement already satisfied: attrs>=17.4.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from twisted) (18.2.0) Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from zope.interface>=4.4.2->twisted) (39.0.1) Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from Automat>=0.3.0->twisted) (1.11.0) Requirement already satisfied: idna>=2.5 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from hyperlink>=17.1.1->twisted) (2.7) Building wheels for collected packages: twisted Running setup.py bdist_wheel for twisted ... done Stored in directory: /Users/Mescetina/Library/Caches/pip/wheels/57/2e/89/11ba83bc08ac30a5e3a6005f0310c78d231b96a270def88ca0 Successfully built twisted
苹果macOS 10.14的更新去除了/usr/include,导致pip找不到header文件,从而阻止了Twisted库的安装。希望我的solution能帮到大家。
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/44985.html
摘要:在上安装标签空格分隔监控首先说一句,在上安装真的很坑爹。。。或如果上面这个方法无法安装那就用源码安装的方法。安装开始好几次就死在安装这个上面,版本的通过命令安装的不行,对应版本的包的名字叫做。 在 CentOS 5.8 上安装 Graphite 标签(空格分隔): 监控 monitor CentOS 5.8 Graphite 首先说一句,在 CentOS 5.8 上安装真的很坑爹...
摘要:所以如果对爬虫有一定基础,上手框架是一种好的选择。缺少包,使用安装即可缺少包,使用安装即可上一篇文章网络爬虫实战爬取相关库的安装的安装下一篇文章网络爬虫实战爬虫框架的安装 上一篇文章:Python3网络爬虫实战---9、APP爬取相关库的安装:Appium的安装下一篇文章:Python3网络爬虫实战---11、爬虫框架的安装:ScrapySplash、ScrapyRedis 我们直接...
摘要:下安装出错注意用,从起,变更为安装的驱动是的但是毫不意外的出错了一般安装运行上面的神器命令都会出错,即使在下也是,直接上解决办法到下载二进制安装包网站打开大概是酱紫的通过搜索然后就酱紫了下载位版本然后运行安装然后稍等一下 windows下mysql-python安装出错 注意:python2.x用mysql-python,从Python3.x起,变更为mysqlclient windo...
摘要:安装重新编译然后重新安装遇到遇到之后,再重新安装即可。安装完成安装安装出现问题解决方法修改文件,路径位于的安装路径下的文件。在下添加如下几行依然报错尝试解决依然报错使用安装包直接进行安装,发现是以下问题安装遇到问题终于大功告成 CentOS大数据实验环境更改记录 标签(空格分隔): 未分类 1.修改163的yum源 使用说明 首先备份/etc/yum.repos.d/CentOS-B...
阅读 3946·2021-10-09 09:43
阅读 2875·2021-10-08 10:05
阅读 2735·2021-09-08 10:44
阅读 886·2019-08-30 15:52
阅读 2812·2019-08-26 17:01
阅读 3019·2019-08-26 13:54
阅读 1654·2019-08-26 10:48
阅读 809·2019-08-23 14:41