简体   繁体   中英

Can't import pmdarima even though it's installed properly

I have a working installation of pmdarima in a conda enviroment

(pmdarima) > pip list | findstr pmdarima

pmdarima 1.1.0

And when I run python I am able to import pmdarima.

(pmdarima) > python

Python 3.7.2 | packaged by conda-forge | (default, Mar 20 2019, 01:38:26) [MSC v.1900 64 bit (AMD64)] :: Anaconda, Inc. on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> from pmdarima.arima import auto_arima

>>>

But when I run a python script which imports pmdarima package I get this error.

(pmdarima) > python pmdarima.py

Traceback (most recent call last):

File "pmdarima.py", line 4, in

from pmdarima.arima import auto_arima

File "project_path\\pmdarima.py", line 4, in

from pmdarima.arima import auto_arima

ModuleNotFoundError: No module named 'pmdarima.arima'; 'pmdarima' is not a package

After getting this error I reopen python in the same enviroment and I cant even import the package here anymore

(pmdarima) > python

Python 3.7.2 | packaged by conda-forge | (default, Mar 20 2019, 01:38:26) [MSC v.1900 64 bit (AMD64)] :: Anaconda, Inc. on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> from pmdarima.arima import auto_arima

Traceback (most recent call last):

File "", line 1, in

File "project_path\\pmdarima.py", line 4, in

from pmdarima.arima import auto_arima

ModuleNotFoundError: No module named 'pmdarima.arima'; 'pmdarima' is not a package

After restarting the terminal I can import the package again in python and the rest repeats itself

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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