日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

Fatal Python error: Py_Initialize: unable to load the file system codec

作者:NoOne-csdn 更新時間: 2022-04-01 編程語言
打開terminal報錯
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

分析原因:
想清理python的安裝版本,刪掉一些文件后就出現如此了,手賤……

解決:

1. sudo vim /etc/profile/
2. export PYTHONHOME=/Library/Frameworks/Python.framework/Versions/3.7
export PYTHONPATH=.:$PYTHONHOME/bin:$PYTHONHOME/site-packages
export PATH=$PATH:$PYTHONHOME:$PYTHONP

運行之后報錯

Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

繼續修改
刪掉關于anaconda有關的環境變量

perfect!

原文鏈接:https://blog.csdn.net/weixin_40161254/article/details/88576220

欄目分類
最近更新