我下載了一個很酷的 github 以在 jupyter notebook 中運行。但是我需要由作者導(dǎo)入這個“非標(biāo)準(zhǔn)庫”下載了文件我將文件放在同一個文件夾中,確保我的筆記本指向那里。在筆記本中輸入“導(dǎo)入指標(biāo)”(順便說一下,它在https://github.com/voice32/stock_market_indicators/ 中有一個名為 indicator.py 的文件)我收到這個錯誤回溯(最近一次調(diào)用):文件“C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py”,第 2961 行,在 run_code exec(code_obj, self.user_global_ns, self.user_ns) 文件中"", line 5, in import indicator File "C:\Users\ney12\Google Drive\1) Financial Mastery\3) paper assets, trading, Other assets\forex\Van tharp Forex trading system\Ney study of van tharp forex交易系統(tǒng)\外匯初始分析\indicators.py”,第 235 行 val_last = val ^ TabError:在縮進(jìn)中使用不一致的制表符和空格以防萬一我打開命令行并輸入“pip install indicator.py”,但出現(xiàn)錯誤:" 找不到滿足要求的版本 indicator.py (來自版本:) 沒有找到與指標(biāo).py 匹配的分發(fā)版"請幫忙!
2 回答

慕尼黑的夜晚無繁華
TA貢獻(xiàn)1864條經(jīng)驗 獲得超6個贊
錯誤在堆棧跟蹤中:
TabError: inconsistent use of tabs and spaces in indentation
當(dāng)有人在腳本中交替使用制表符和空格進(jìn)行縮進(jìn)時,就會發(fā)生這種情況。相當(dāng)令人沮喪
我建議在您選擇的文本編輯器中打開該文件,然后批量查找和替換選項卡并替換為空格。您可以使用\t
查找欄中的字符(注意轉(zhuǎn)義斜杠)來執(zhí)行此操作,然后\s{4}
(如果啟用了正則表達(dá)式)或在替換字段中按空格 4 次。保存它,然后用一個新的 python shell 重新導(dǎo)入它
添加回答
舉報
0/150
提交
取消