Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ModuleNotFoundError:没有名为';statsmodels&x27;_Python_Python Module - Fatal编程技术网

Python ModuleNotFoundError:没有名为';statsmodels&x27;

Python ModuleNotFoundError:没有名为';statsmodels&x27;,python,python-module,Python,Python Module,我在尝试使用模块statsmodels时遇到上述错误。我已经通过命令行安装了模块,并重新启动了spyder import statsmodels.api as sm from statsmodels.tsa.stattools import adfuller 我不知道这是否相关,但我使用MacOSX,它使用Python 2.7.16作为默认值,但我在spyder中使用3.9.5 任何帮助都将不胜感激。如果您有多个python版本,则可能使用错误的版本运行程序。你能再检查一下吗?如果你有很多版本

我在尝试使用模块statsmodels时遇到上述错误。我已经通过命令行安装了模块,并重新启动了spyder

import statsmodels.api as sm
from statsmodels.tsa.stattools import adfuller
我不知道这是否相关,但我使用MacOSX,它使用Python 2.7.16作为默认值,但我在spyder中使用3.9.5


任何帮助都将不胜感激。

如果您有多个python版本,则可能使用错误的版本运行程序。你能再检查一下吗?如果你有很多版本,那么你必须以正确的版本安装它。如果使用
python3
运行代码,则可以使用
python3-m pip安装…
python2
安装模块。每个版本都需要自己安装。@furas我在命令行中运行了这个,它说已经很满意了,我想我可能在尝试将它安装到workSpyder时已经尝试过了。Pyder可能会使用不同的Python。在Spyder
导入系统中运行;打印(sys.executable)
以获取Spyder中使用的Python的完整路径。然后,您可以使用
/full/path/to/python-m pip install…
@furas对此回复太晚表示歉意,我现在收到以下错误
致命Python错误:init\u fs\u encoding:无法获取文件系统的Python编解码器编码Python运行时状态:core initialized ModuleNotFoundError:没有名为“encodings”的模块