Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'pmdarima' #124

Closed
weianuk opened this issue Apr 12, 2019 · 29 comments
Closed

ModuleNotFoundError: No module named 'pmdarima' #124

weianuk opened this issue Apr 12, 2019 · 29 comments

Comments

@weianuk
Copy link

weianuk commented Apr 12, 2019

Already updated the required packages to install pmdarima, and then installed the package, but the package still cannot be imported.

[1] import pmdarima as pm
Traceback (most recent call last):

  File "<ipython-input-13-05191c3ae93f>", line 1, in <module>
    import pmdarima as pm

ModuleNotFoundError: No module named 'pmdarima'

Tried uninstalling the package and reinstall it, but still cannot install pmdarima. What's the problem with it?

@tgsmith61591
Copy link
Member

Do you have your conda environment or virtualenv sourced? Can you run pip freeze?

@tgsmith61591
Copy link
Member

Also can you paste the entire output of your pip install pmdarima here?

@weianuk
Copy link
Author

weianuk commented Apr 12, 2019

Do you have your conda environment or virtualenv sourced? Can you run pip freeze?

I can run pip freeze. Heads of the output are as follows:

alabaster==0.7.12
altgraph==0.16.1
anaconda-client==1.7.2
anaconda-navigator==1.9.6
anaconda-project==0.8.2
asn1crypto==0.24.0
astroid==2.1.0
astropy==3.1
atomicwrites==1.2.1
......

@tgsmith61591
Copy link
Member

I need all of the output :-) trying to see if it's being installed properly...

@weianuk
Copy link
Author

weianuk commented Apr 12, 2019

Also can you paste the entire output of your pip install pmdarima here?

Firstly, I uninstalled the package in the Anaconda Prompt:

(base) C:\Users\WIN>pip uninstall pmdarima
Uninstalling pmdarima-1.1.1:
  Would remove:
    c:\users\WIN\anaconda3\lib\site-packages\pmdarima-1.1.1.dist-info\*
    c:\users\WIN\anaconda3\lib\site-packages\pmdarima\*
Proceed (y/n)? y
  Successfully uninstalled pmdarima-1.1.1

Then, I re-installed the package:

(base) C:\Users\WIN>pip install pmdarima
Collecting pmdarima
  Using cached https://files.pythonhosted.org/packages/2f/fd/71ceb6d934f8f32addd19b9ede7c77da0daa87aa34a3a7a7b20bfbfa0849/pmdarima-1.1.1-cp37-cp37m-win_amd64.whl
Requirement already satisfied: scikit-learn>=0.19 in c:\users\WIN\anaconda3\lib\site-packages (from pmdarima) (0.20.1)
Requirement already satisfied: Cython>=0.29 in c:\users\WIN\anaconda3\lib\site-packages (from pmdarima) (0.29.2)
Requirement already satisfied: scipy>=1.0 in c:\users\WIN\anaconda3\lib\site-packages (from pmdarima) (1.1.0)
Requirement already satisfied: numpy>=1.10 in c:\users\WIN\anaconda3\lib\site-packages (from pmdarima) (1.15.4)
Requirement already satisfied: pandas>=0.19 in c:\users\xiaokai\anaconda3\lib\site-packages (from pmdarima) (0.23.4)
Requirement already satisfied: statsmodels>=0.9.0 in c:\users\WIN\anaconda3\lib\site-packages (from pmdarima) (0.9.0)
Requirement already satisfied: python-dateutil>=2.5.0 in c:\users\WIN\anaconda3\lib\site-packages (from pandas>=0.19->pmdarima) (2.7.5)
Requirement already satisfied: pytz>=2011k in c:\users\WIN\anaconda3\lib\site-packages (from pandas>=0.19->pmdarima) (2018.7)
Requirement already satisfied: six>=1.5 in c:\users\WIN\anaconda3\lib\site-packages (from python-dateutil>=2.5.0->pandas>=0.19->pmdarima) (1.12.0)
Installing collected packages: pmdarima
Successfully installed pmdarima-1.1.1

The installation seems to be normal. But do not know why it cannot be imported in Spyder (IPython console).
@tgsmith61591

@weianuk
Copy link
Author

weianuk commented Apr 12, 2019

I need all of the output :-) trying to see if it's being installed properly...

The whole output for pip freeze:

(base) C:\Users\WIN>pip freeze
alabaster==0.7.12
altgraph==0.16.1
anaconda-client==1.7.2
anaconda-navigator==1.9.6
anaconda-project==0.8.2
asn1crypto==0.24.0
astroid==2.1.0
astropy==3.1
atomicwrites==1.2.1
attrs==18.2.0
Babel==2.6.0
backcall==0.1.0
backports.os==0.1.1
backports.shutil-get-terminal-size==1.0.0
beautifulsoup4==4.6.3
bitarray==0.8.3
bkcharts==0.2
blaze==0.11.3
bleach==3.0.2
bokeh==1.0.2
boto==2.49.0
Bottleneck==1.2.1
certifi==2018.11.29
cffi==1.11.5
chardet==3.0.4
Click==7.0
cloudpickle==0.6.1
clyent==1.2.2
colorama==0.4.1
comtypes==1.1.7
conda==4.6.12
conda-build==3.17.6
conda-verify==3.1.1
contextlib2==0.5.5
cryptography==2.4.2
cycler==0.10.0
Cython==0.29.2
cytoolz==0.9.0.1
dask==1.0.0
datashape==0.5.4
decorator==4.3.0
defusedxml==0.5.0
distributed==1.25.1
docutils==0.14
drms==0.5.6
entrypoints==0.2.3
et-xmlfile==1.0.1
fastcache==1.0.2
filelock==3.0.10
Flask==1.0.2
Flask-Cors==3.0.7
future==0.17.1
gevent==1.3.7
glob2==0.6
Glymur==0.8.17
greenlet==0.4.15
h5py==2.8.0
heapdict==1.0.0
html5lib==1.0.1
hupper==1.6.1
idna==2.8
imageio==2.4.1
imagesize==1.1.0
importlib-metadata==0.6
ipykernel==5.1.0
ipython==7.2.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
isort==4.3.4
itsdangerous==1.1.0
jdcal==1.4
jedi==0.13.2
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
jupyterlab==0.35.3
jupyterlab-server==0.2.0
keyring==17.0.0
kiwisolver==1.0.1
lazy-object-proxy==1.3.1
libarchive-c==2.8
llvmlite==0.26.0
locket==0.2.0
lxml==4.2.5
macholib==1.11
MarkupSafe==1.1.0
matplotlib==3.0.2
mccabe==0.6.1
menuinst==1.4.14
mistune==0.8.4
mkl-fft==1.0.6
mkl-random==1.0.2
more-itertools==4.3.0
mpmath==1.1.0
msgpack==0.5.6
multipledispatch==0.6.0
navigator-updater==0.2.1
nbconvert==5.4.0
nbformat==4.4.0
networkx==2.2
nltk==3.4
nose==1.3.7
notebook==5.7.4
numba==0.41.0
numexpr==2.6.8
numpy==1.15.4
numpydoc==0.8.0
odo==0.5.1
olefile==0.46
openpyxl==2.5.12
packaging==18.0
pandas==0.23.4
pandocfilters==1.4.2
parso==0.3.1
partd==0.3.9
PasteDeploy==1.5.2
path.py==11.5.0
pathlib2==2.3.3
patsy==0.5.1
pefile==2018.8.8
pep8==1.7.1
pickleshare==0.7.5
Pillow==5.3.0
pkginfo==1.4.2
plaster==1.0
plaster-pastedeploy==0.6
pluggy==0.8.0
ply==3.11
pmdarima==1.1.1
prometheus-client==0.5.0
prompt-toolkit==2.0.7
psutil==5.4.8
py==1.7.0
pycodestyle==2.4.0
pycosat==0.6.3
pycparser==2.19
pycrypto==2.6.1
pycurl==7.43.0.2
pyflakes==2.0.0
Pygments==2.3.1
PyInstaller==3.4
pylint==2.2.2
pyodbc==4.0.25
pyOpenSSL==18.0.0
pyparsing==2.3.0
pyqtgraph==0.10.0
PySocks==1.6.8
pytest==4.0.2
pytest-arraydiff==0.3
pytest-astropy==0.5.0
pytest-doctestplus==0.2.0
pytest-openfiles==0.3.1
pytest-remotedata==0.3.1
python-dateutil==2.7.5
pytz==2018.7
PyWavelets==1.0.1
pywin32==223
pywin32-ctypes==0.2.0
pywinpty==0.5.5
PyYAML==3.13
pyzmq==17.1.2
QtAwesome==0.5.3
qtconsole==4.4.3
QtPy==1.5.2
requests==2.21.0
rope==0.11.0
rpy2==2.9.4
ruamel-yaml==0.15.46
scikit-image==0.14.1
scikit-learn==0.20.1
scipy==1.1.0
seaborn==0.9.0
Send2Trash==1.5.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.12.0
snowballstemmer==1.2.1
sortedcollections==1.0.1
sortedcontainers==2.1.0
Sphinx==1.8.2
sphinxcontrib-websupport==1.1.0
spyder==3.3.2
spyder-kernels==0.3.0
SQLAlchemy==1.2.15
statsmodels==0.9.0
suds-jurko==0.6
sunpy==0.9.6
sympy==1.3
tables==3.4.4
tblib==1.3.2
terminado==0.8.1
testpath==0.4.2
toolz==0.9.0
tornado==5.1.1
tqdm==4.28.1
traitlets==4.3.2
translationstring==1.3
unicodecsv==0.14.1
urllib3==1.24.1
venusian==1.1.0
wcwidth==0.1.7
webencodings==0.5.1
WebOb==1.8.5
Werkzeug==0.14.1
widgetsnbextension==3.4.2
win-inet-pton==1.0.1
win-unicode-console==0.5
wincertstore==0.2
wrapt==1.10.11
xlrd==1.2.0
XlsxWriter==1.1.2
xlwings==0.15.1
xlwt==1.3.0
zict==0.1.3
zope.deprecation==4.4.0
zope.interface==4.6.0

@tgsmith61591
Copy link
Member

And you've sourced your conda environment?

@weianuk
Copy link
Author

weianuk commented Apr 12, 2019

And you've sourced your conda environment?

:) What do you mean by sourcing the conda envrionment? I have been using the Spyder of anaconda.

@tgsmith61591
Copy link
Member

tgsmith61591 commented Apr 12, 2019

As in source activate your_env_name

@tgsmith61591
Copy link
Member

tgsmith61591 commented Apr 12, 2019

Well, you're on Windows so just activate your_env_name

@weianuk
Copy link
Author

weianuk commented Apr 12, 2019

Well, you're on Windows so just activate your_package_name

So you mean I need to have the following line before import pmdarima?
source activate pmdarima

@tgsmith61591
Copy link
Member

tgsmith61591 commented Apr 12, 2019

No. When you create a conda environment or virtual environment, you have to activate it... That's what I'm asking whether you've done.

How about this. Run:

import sys
print(sorted(sys.path))

(From Python)

@weianuk
Copy link
Author

weianuk commented Apr 12, 2019

No. When you create a conda environment or virtual environment, you have to activate it... That's what I'm asking whether you've done.

How about this. Run:

import sys
print(sorted(sys.path))

(From Python)

It gives the following:

import sys
print(sorted(sys.path))
['', 'C:\\Users\\WIN\\.ipython', 'C:\\Users\\WIN\\Anaconda3', 'C:\\Users\\WIN\\Anaconda3\\DLLs', 'C:\\Users\\WIN\\Anaconda3\\lib', 'C:\\Users\\WIN\\Anaconda3\\lib\\site-packages', 'C:\\Users\\WIN\\Anaconda3\\lib\\site-packages\\IPython\\extensions', 'C:\\Users\\WIN\\Anaconda3\\lib\\site-packages\\Pythonwin', 'C:\\Users\\WIN\\Anaconda3\\lib\\site-packages\\rpy2-2.9.4-py3.7-win-amd64.egg', 'C:\\Users\\WIN\\Anaconda3\\lib\\site-packages\\win32', 'C:\\Users\\WIN\\Anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\Users\\WIN\\Anaconda3\\python37.zip', 'C:\\Users\\WIN\\OneDrive\\Spyder']

@tgsmith61591
Copy link
Member

tgsmith61591 commented Apr 12, 2019

Ok I was looking to make sure site-packages was there. Can you import pmdarima from Python? (NOT ipython)

python -c 'import pmdarima; print("it worked")'

(Edited)

@weianuk
Copy link
Author

weianuk commented Apr 12, 2019

Ok I was looking to make sure site-packages was there. Can you import pmdarima from Python? (NOT ipython)

python -c 'import pmdarima; print("it worked")'

(Edited)

I now only have the Spyder of Anaconda, and do not know how to run it from Python. Tried it in the Spyder console but gives error.

@tgsmith61591
Copy link
Member

I don't really know what to say. The package installed fine in your site-packages. Something is wrong with your PYTHON_PATH

@weianuk
Copy link
Author

weianuk commented Apr 12, 2019

I don't really know what to say. The package installed fine in your site-packages. Something is wrong with your PYTHON_PATH

Thanks! Should I reinstall the anaconda? I guess something corrupted there?

@tgsmith61591
Copy link
Member

tgsmith61591 commented Apr 12, 2019

I don't use Spyder. But a quick Google search:

https://stackoverflow.com/questions/11919615/how-to-change-the-path-of-python-in-spyder

It might be pointing to the wrong executable

@mahezsh
Copy link

mahezsh commented Dec 10, 2019

!pip3 install pmdarima

Requirement already satisfied: pmdarima in /usr/local/lib/python3.7/site-packages (1.5.1)
Requirement already satisfied: Cython>=0.29 in /usr/local/lib/python3.7/site-packages (from pmdarima) (0.29.14)
Requirement already satisfied: numpy>=1.16 in /usr/local/lib/python3.7/site-packages (from pmdarima) (1.17.1)
Requirement already satisfied: six>=1.5 in /Users/macbook/Library/Python/3.7/lib/python/site-packages (from pmdarima) (1.12.0)
Requirement already satisfied: scikit-learn>=0.19 in /usr/local/lib/python3.7/site-packages (from pmdarima) (0.21.3)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/site-packages (from pmdarima) (0.13.2)
Requirement already satisfied: scipy>=1.3 in /usr/local/lib/python3.7/site-packages (from pmdarima) (1.3.1)
Requirement already satisfied: pandas>=0.19 in /usr/local/lib/python3.7/site-packages (from pmdarima) (0.25.1)
Requirement already satisfied: statsmodels>=0.10.0 in /usr/local/lib/python3.7/site-packages (from pmdarima) (0.10.2)
Requirement already satisfied: pathlib in /usr/local/lib/python3.7/site-packages (from pmdarima) (1.0.1)
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.7/site-packages (from pandas>=0.19->pmdarima) (2.8.0)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/site-packages (from pandas>=0.19->pmdarima) (2019.2)
Requirement already satisfied: patsy>=0.4.0 in /usr/local/lib/python3.7/site-packages (from statsmodels>=0.10.0->pmdarima) (0.5.1)

sys.path.insert(0, "/usr/local/lib/python3.7/site-packages")

import pmdarima

@tgsmith61591
Copy link
Member

What is the issue? Your log shows it was installed, but what's the error?

@Nad131
Copy link

Nad131 commented Mar 21, 2020

Hi there

I also have issues with importing pmdarima. I don't know why as I already went through a lot of the errors about it and i don't see what is the issue.

>pip install pmdarima Collecting pmdarima Downloading pmdarima-1.5.3-cp38-cp38-win_amd64.whl (601 kB) |████████████████████████████████| 601 kB 2.2 MB/s Requirement already satisfied: scipy>=1.3.2 in c:\python38\lib\site-packages (from pmdarima) (1.4.1) Requirement already satisfied: pandas>=0.19 in c:\python38\lib\site-packages (from pmdarima) (1.0.1) Collecting joblib>=0.11 Downloading joblib-0.14.1-py2.py3-none-any.whl (294 kB) |████████████████████████████████| 294 kB 3.3 MB/s Collecting statsmodels>=0.10.2 Downloading statsmodels-0.11.1-cp38-none-win_amd64.whl (8.3 MB) |████████████████████████████████| 8.3 MB 3.3 MB/s Requirement already satisfied: numpy>=1.17.3 in c:\python38\lib\site-packages (from pmdarima) (1.18.1) Collecting Cython>=0.29 Downloading Cython-0.29.15-cp38-cp38-win_amd64.whl (1.7 MB) |████████████████████████████████| 1.7 MB 3.3 MB/s Collecting urllib3 Downloading urllib3-1.25.8-py2.py3-none-any.whl (125 kB) |████████████████████████████████| 125 kB 3.3 MB/s Collecting scikit-learn>=0.22 Downloading scikit_learn-0.22.2.post1-cp38-cp38-win_amd64.whl (6.6 MB) |████████████████████████████████| 6.6 MB 3.2 MB/s Requirement already satisfied: pytz>=2017.2 in c:\python38\lib\site-packages (from pandas>=0.19->pmdarima) (2019.3) Requirement already satisfied: python-dateutil>=2.6.1 in c:\python38\lib\site-packages (from pandas>=0.19->pmdarima) (2.8.1) Collecting patsy>=0.5 Downloading patsy-0.5.1-py2.py3-none-any.whl (231 kB) |████████████████████████████████| 231 kB 3.3 MB/s Requirement already satisfied: six>=1.5 in c:\python38\lib\site-packages (from python-dateutil>=2.6.1->pandas>=0.19->pmdarima) (1.14.0) Installing collected packages: joblib, patsy, statsmodels, Cython, urllib3, scikit-learn, pmdarima Successfully installed Cython-0.29.15 joblib-0.14.1 patsy-0.5.1 pmdarima-1.5.3 scikit-learn-0.22.2.post1 statsmodels-0.11.1 urllib3-1.25.8

>pip freeze argcomplete==1.11.1 async-generator==1.10 attrs==19.3.0 backcall==0.1.0 bleach==3.1.1 click==7.1.1 colorama==0.4.3 cycler==0.10.0 Cython==0.29.15 dash==1.8.0 dash-core-components==1.7.0 dash-html-components==1.0.2 dash-renderer==1.2.3 dash-table==4.6.0 decorator==4.4.2 defusedxml==0.6.0 entrypoints==0.3 Flask==1.1.1 Flask-Compress==1.4.0 future==0.18.2 gunicorn==20.0.4 ipykernel==5.1.4 ipympl==0.5.3 ipython==7.13.0 ipython-genutils==0.2.0 ipywidgets==7.5.1 itsdangerous==1.1.0 jedi==0.16.0 Jinja2==2.11.1 joblib==0.14.1 jsonschema==3.2.0 jupyter-client==6.0.0 jupyter-core==4.6.3 jupyter-server==0.1.1 jupyterlab-pygments==0.1.0 kiwisolver==1.1.0 MarkupSafe==1.1.1 matplotlib==3.2.0 mistune==0.8.4 nbconvert==5.6.1 nbformat==5.0.4 notebook==6.0.3 numpy==1.18.1 pandas==1.0.1 pandocfilters==1.4.2 parso==0.6.2 patsy==0.5.1 pickleshare==0.7.5 pipx==0.15.1.3 plotly==4.5.3 pmdarima==1.5.3 prometheus-client==0.7.1 prompt-toolkit==3.0.4 Pygments==2.6.1 pyparsing==2.4.6 pyrsistent==0.15.7 python-dateutil==2.8.1 pytz==2019.3 pywin32==227 pywinpty==0.5.7 pyzmq==19.0.0 retrying==1.3.3 scikit-learn==0.22.2.post1 scipy==1.4.1 Send2Trash==1.5.0 six==1.14.0 statsmodels==0.11.1 terminado==0.8.3 testpath==0.4.4 tornado==6.0.4 traitlets==4.3.3 urllib3==1.25.8 userpath==1.3.0 voila==0.1.21 voila-vuetify==0.2.2 wcwidth==0.1.8 webencodings==0.5.1 Werkzeug==1.0.0 widgetsnbextension==3.5.1

@aaronreidsmith
Copy link
Member

@Nad131, could you show us the actual stack trace rather than just the fact that it installed?

Also, it’s preferable for you to open a new issue, as it will ask some leading questions to get the info we need to help out.

@Nad131
Copy link

Nad131 commented Mar 22, 2020

@aaronreidsmith the actual stack trace is below, which is exactly this issue here.. I can open a new issue if you like

`---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
in
22 import sys
23 from statsmodels.tsa.ar_model import AR,ARResults
---> 24 from pmdarima import auto_arima
25

ModuleNotFoundError: No module named 'pmdarima'
`

@tgsmith61591
Copy link
Member

Are you using a venv or conda? Any other package manager? Can you print out sys.path?

@Nad131
Copy link

Nad131 commented Mar 23, 2020

I use conda no venv.

my sys.path is:

['', 'C:\\ProgramData\\Anaconda3', 'C:\\ProgramData\\Anaconda3\\DLLs', 'C:\\ProgramData\\Anaconda3\\lib', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\IPython\\extensions', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\Pythonwin', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32', 'C:\\ProgramData\\Anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\ProgramData\\Anaconda3\\python37.zip', 'C:\\Users\\leinw\\.ipython', 'C:\\Users\\leinw\\PycharmProjects\\DaVi_StatDa_Projekte']

@tgsmith61591
Copy link
Member

From your earlier logs:

Collecting pmdarima Downloading pmdarima-1.5.3-cp38-cp38-win_amd64.whl

This would suggest you downloaded the version tied to python 3.8? But then later you were running python 3.7. Your environment had to have changed.

@Nad131
Copy link

Nad131 commented Mar 23, 2020

Got it thank you so much. I was running Anaconda which still has 3.7 and on Windows I additionally have 3.8.

Now I made sure to have the correct anaconda venv activated. That worked like a charm. :)

@PedroSouza-Dev
Copy link

install using "pip install pmdarima." in Anaconda prompt instead the regular cmd. I had the same problems and works this way.

@yogeshvin22
Copy link

hi!
i am using Jupyter notebook, ihave installed pmdarima ,but when iam importing it in the Jupyter notebook its showing module not found error,plz suggest me what could be the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants