摘要:在使用安裝庫(kù)時(shí)出現(xiàn)以下錯(cuò)誤在網(wǎng)上搜了很久,僅發(fā)現(xiàn)針對(duì)的解決方案。在一番研究后,發(fā)現(xiàn)的故意刪除了??梢钥吹轿募A被恢復(fù)了。在這之后再執(zhí)行結(jié)果顯示蘋果的更新去除了,導(dǎo)致找不到文件,從而阻止了庫(kù)的安裝。
Environment: macOS mojave - 10.14.1; python 2.7.15/python 3.7.1.
在使用pip安裝Twisted庫(kù)時(shí)出現(xiàn)以下錯(cuò)誤:
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
在網(wǎng)上搜了很久,僅發(fā)現(xiàn)針對(duì)linux的解決方案。沒(méi)有人提到macOS。
在一番研究后,發(fā)現(xiàn)macOS mojave的update故意刪除了/user/include。于是想到是否因?yàn)?usr/include不存在了,所以pip找不到limit.h了呢。
于是執(zhí)行了下面這行命令,重新手動(dòng)恢復(fù)/usr/include文件夾。
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
可以看到/usr/include文件夾被恢復(fù)了。
在這之后再執(zhí)行
pip install Twisted
結(jié)果顯示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,導(dǎo)致pip找不到header文件,從而阻止了Twisted庫(kù)的安裝。希望我的solution能幫到大家。
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://m.hztianpu.com/yun/44985.html
摘要:在上安裝標(biāo)簽空格分隔監(jiān)控首先說(shuō)一句,在上安裝真的很坑爹。。?;蛉绻厦孢@個(gè)方法無(wú)法安裝那就用源碼安裝的方法。安裝開(kāi)始好幾次就死在安裝這個(gè)上面,版本的通過(guò)命令安裝的不行,對(duì)應(yīng)版本的包的名字叫做。 在 CentOS 5.8 上安裝 Graphite 標(biāo)簽(空格分隔): 監(jiān)控 monitor CentOS 5.8 Graphite 首先說(shuō)一句,在 CentOS 5.8 上安裝真的很坑爹...
摘要:所以如果對(duì)爬蟲(chóng)有一定基礎(chǔ),上手框架是一種好的選擇。缺少包,使用安裝即可缺少包,使用安裝即可上一篇文章網(wǎng)絡(luò)爬蟲(chóng)實(shí)戰(zhàn)爬取相關(guān)庫(kù)的安裝的安裝下一篇文章網(wǎng)絡(luò)爬蟲(chóng)實(shí)戰(zhàn)爬蟲(chóng)框架的安裝 上一篇文章:Python3網(wǎng)絡(luò)爬蟲(chóng)實(shí)戰(zhàn)---9、APP爬取相關(guān)庫(kù)的安裝:Appium的安裝下一篇文章:Python3網(wǎng)絡(luò)爬蟲(chóng)實(shí)戰(zhàn)---11、爬蟲(chóng)框架的安裝:ScrapySplash、ScrapyRedis 我們直接...
摘要:下安裝出錯(cuò)注意用,從起,變更為安裝的驅(qū)動(dòng)是的但是毫不意外的出錯(cuò)了一般安裝運(yùn)行上面的神器命令都會(huì)出錯(cuò),即使在下也是,直接上解決辦法到下載二進(jìn)制安裝包網(wǎng)站打開(kāi)大概是醬紫的通過(guò)搜索然后就醬紫了下載位版本然后運(yùn)行安裝然后稍等一下 windows下mysql-python安裝出錯(cuò) 注意:python2.x用mysql-python,從Python3.x起,變更為mysqlclient windo...
摘要:安裝重新編譯然后重新安裝遇到遇到之后,再重新安裝即可。安裝完成安裝安裝出現(xiàn)問(wèn)題解決方法修改文件,路徑位于的安裝路徑下的文件。在下添加如下幾行依然報(bào)錯(cuò)嘗試解決依然報(bào)錯(cuò)使用安裝包直接進(jìn)行安裝,發(fā)現(xiàn)是以下問(wèn)題安裝遇到問(wèn)題終于大功告成 CentOS大數(shù)據(jù)實(shí)驗(yàn)環(huán)境更改記錄 標(biāo)簽(空格分隔): 未分類 1.修改163的yum源 使用說(shuō)明 首先備份/etc/yum.repos.d/CentOS-B...
閱讀 4088·2021-10-09 09:43
閱讀 2935·2021-10-08 10:05
閱讀 2824·2021-09-08 10:44
閱讀 938·2019-08-30 15:52
閱讀 2900·2019-08-26 17:01
閱讀 3081·2019-08-26 13:54
閱讀 1723·2019-08-26 10:48
閱讀 880·2019-08-23 14:41