无法在 spyder 中安装软件包

时间:2021-03-11 13:41:16

标签: python installation package spyder

我需要使用 statsmodels,但我已经尝试通过 spyder 安装它,使用 !pip3 install statsmodels 我明白了:

Python path configuration:
PYTHONHOME = '/Applications/Spyder.app/Contents/Resources'
PYTHONPATH = '/Applications/Spyder.app/Contents/Resources'
program name = '/Applications/Xcode.app/Contents/Developer/usr/bin/python3'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = '/Applications/Xcode.app/Contents/Developer/usr/bin/python3'
sys.base_prefix = '/Applications/Spyder.app/Contents/Resources'
sys.base_exec_prefix = '/Applications/Spyder.app/Contents/Resources'
sys.executable = '/Applications/Xcode.app/Contents/Developer/usr/bin/python3'
sys.prefix = '/Applications/Spyder.app/Contents/Resources'
sys.exec_prefix = '/Applications/Spyder.app/Contents/Resources'
sys.path = [
    '/Applications/Spyder.app/Contents/Resources',
    '/Applications/Spyder.app/Contents/Resources/lib/python38.zip',
    '/Applications/Spyder.app/Contents/Resources/lib/python3.8',
    '/Applications/Spyder.app/Contents/Resources/lib/python3.8/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem 
encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0000000118d81e00 (most recent call first):
<no Python frame>

我也通过终端尝试过,它可以工作,但是 spyder 无论如何都无法识别 statsmodels。 pip 和 Python 都是最新的

0 个答案:

没有答案