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