简体   繁体   English

即使安装正确,也无法导入pmdarima

[英]Can't import pmdarima even though it's installed properly

I have a working installation of pmdarima in a conda enviroment 我在conda环境中安装了pmdarima

(pmdarima) > pip list | (pmdarima)>点子列表| findstr pmdarima findstr pmdarima

pmdarima 1.1.0 pmdarima 1.1.0

And when I run python I am able to import pmdarima. 当我运行python时,我可以导入pmdarima。

(pmdarima) > python (pmdarima)> python

Python 3.7.2 | Python 3.7.2 | packaged by conda-forge | 由conda-forge打包| (default, Mar 20 2019, 01:38:26) [MSC v.1900 64 bit (AMD64)] :: Anaconda, Inc. on win32 (默认,2019年3月20日,01:38:26)[MSC v.1900 64 bit(AMD64)] :: win32上的Anaconda,Inc。

Type "help", "copyright", "credits" or "license" for more information. 输入“帮助”,“版权”,“信用”或“许可”以获取更多信息。

>>> from pmdarima.arima import auto_arima >>>来自pmdarima.arima import auto_arima

>>> >>>

But when I run a python script which imports pmdarima package I get this error. 但是,当我运行导入pmdarima包的python脚本时,我收到此错误。

(pmdarima) > python pmdarima.py (pmdarima)> python pmdarima.py

Traceback (most recent call last): Traceback(最近一次调用最后一次):

File "pmdarima.py", line 4, in 文件“pmdarima.py”,第4行,in

from pmdarima.arima import auto_arima 来自pmdarima.arima import auto_arima

File "project_path\\pmdarima.py", line 4, in 文件“project_path \\ pmdarima.py”,第4行,in

from pmdarima.arima import auto_arima 来自pmdarima.arima import auto_arima

ModuleNotFoundError: No module named 'pmdarima.arima'; ModuleNotFoundError:没有名为'pmdarima.arima'的模块; 'pmdarima' is not a package 'pmdarima'不是一个包

After getting this error I reopen python in the same enviroment and I cant even import the package here anymore 得到这个错误后,我在同一个环境中重新打开python,我甚至不能再在这里导入包了

(pmdarima) > python (pmdarima)> python

Python 3.7.2 | Python 3.7.2 | packaged by conda-forge | 由conda-forge打包| (default, Mar 20 2019, 01:38:26) [MSC v.1900 64 bit (AMD64)] :: Anaconda, Inc. on win32 (默认,2019年3月20日,01:38:26)[MSC v.1900 64 bit(AMD64)] :: win32上的Anaconda,Inc。

Type "help", "copyright", "credits" or "license" for more information. 输入“帮助”,“版权”,“信用”或“许可”以获取更多信息。

>>> from pmdarima.arima import auto_arima >>>来自pmdarima.arima import auto_arima

Traceback (most recent call last): Traceback(最近一次调用最后一次):

File "", line 1, in 文件“”,第1行,in

File "project_path\\pmdarima.py", line 4, in 文件“project_path \\ pmdarima.py”,第4行,in

from pmdarima.arima import auto_arima 来自pmdarima.arima import auto_arima

ModuleNotFoundError: No module named 'pmdarima.arima'; ModuleNotFoundError:没有名为'pmdarima.arima'的模块; 'pmdarima' is not a package 'pmdarima'不是一个包

After restarting the terminal I can import the package again in python and the rest repeats itself 重新启动终端后,我可以在python中再次导入包,其余的重复

The problem was the name of my file. 问题是我的文件的名称。 It was conficting with the name of the library. 它令人困惑的是图书馆的名字。 Thanks for your vote. 谢谢你的投票。 It realy helped a lot! 它确实帮了很多忙!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM