雖然使用Anaconda已經幫我們避開大量可能發生的錯誤,但是可能是人品不好,我還是常常遇到一堆亂七八糟個問題,而且是「重複出現」。沒辦法,總不能把時間都花在重複上網搜尋問題吧,因此決定我把發生過的問題與解決方法一一列出來,備查。
狀況:使用Anaconda Prompt命令提示字元進入python環境時出現錯誤訊息:
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type “help", “copyright", “credits" or “license" for more information.
Failed calling sys.interactivehook
Traceback (most recent call last):
File “C:\Users\akey\anaconda3\lib\site.py", line 439, in register_readline
readline.read_history_file(history)
File “C:\Users\akey\anaconda3\lib\site-packages\pyreadline\rlmain.py", line 165, in read_history_file
self.mode._history.read_history_file(filename)
File “C:\Users\akey\anaconda3\lib\site-packages\pyreadline\lineeditor\history.py", line 82, in read_history_file
for line in open(filename, ‘r’):
UnicodeDecodeError: ‘cp950’ codec can’t decode byte 0x8f in position 664: illegal multibyte sequence
解決辦法:刪除家目錄中的 .python_history 檔案
適用環境:WINDOW、linux
狀況:使用Anaconda安裝完proj相關套件後,再執行Anaconda Prompt命令提示字元出現:
if exist c:\users\akey\anaconda3\library\share\proj\copyright_and_licenses.csv ( rem proj-data is installed because its license was copied over)
else()
解決辦法:
- 找出C:\Anaconda\pkg\……\activate.d\proj4-activate.bat 檔案
- 進入文字編輯,在if段落之前加上@符號忽略
適用環境:WINDOW、linux
發表留言