antoinecarme / pyaf

PyAF is an Open Source Python library for Automatic Time Series Forecasting built on top of popular pydata modules.
BSD 3-Clause "New" or "Revised" License
459 stars 73 forks source link

ImportError: cannot import name 'SignalDecomposition' #83

Closed justmisam closed 6 years ago

justmisam commented 6 years ago

Hi, When I want import 'pyaf.ForecastEngine', I get this errors:

>>> import pyaf.ForecastEngine as autof
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/pyaf/ForecastEngine.py", line 8, in <module>
    from .TS import SignalDecomposition as tsdec
  File "/root/pyaf/TS/SignalDecomposition.py", line 33, in <module>
    from . import TimeSeriesModel as tsmodel
  File "/root/pyaf/TS/TimeSeriesModel.py", line 10, in <module>
    from . import PredictionIntervals as predint
  File "/root/pyaf/TS/PredictionIntervals.py", line 10, in <module>
    from . import SignalDecomposition as sigdec
ImportError: cannot import name 'SignalDecomposition'

Output of 'platform_info.py':

PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('matplotlib_version', '2.1.0')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('numpy_version', '1.13.3')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('pandas_version', '0.21.0')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('pydot_version', '1.2.3')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('python_implementation', 'CPython')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('python_version', '3.4.2')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('scipy_version', '1.0.0')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('sklearn_version', '0.19.1')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('sqlalchemy_version', '1.1.15')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('system_platform', 'Linux-3.14.32-xxxx-grs-ipv6-64-
x86_64-with-Debian-8')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('system_processor', '')
PYAF_SYSTEM_DEPENDENT_VERSION_INFO ('system_uname', uname_result(system='Linux', node='misam', release='3.14.32-xxxx-grs-ipv6-64', version='#9 SMP Thu Oct 20 14:53:52 CEST 2016', 
machine='x86_64', processor=''))
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('HOME', '/root')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('LANG', 'en_GB.UTF-8')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('LANGUAGE', 'en_GB:en')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('LOGNAME', 'root')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('MAIL', '/var/mail/root')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('OLDPWD', '/usr/local/lib/python3.4/dist-
packages/pyaf/TS')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('PATH', '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('PWD', '/root')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('SHELL', '/bin/bash')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('SHLVL', '1')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('TERM', 'xterm-256color')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('USER', 'root')
PYAF_SYSTEM_DEPENDENT_ENVIRONMENT_VARIABLE ('_', '/usr/bin/python3')
antoinecarme commented 6 years ago

@misamplus

Thanks for the report.

There seems to be something wrong with your installation. You are installing pyaf in a user directory. please use the install instructions documented on pyaf github page (pip install ... etc).

Using pyaf in a user directory as root is not really recommended. I cannot guarantee that pyaf will not destroy your system in this case ;)

Please create a user and define a PYTHONPATH that contains the pyaf directory :

export PYTHONPATH=pyaf_parent_directroy

or use pip install method.

justmisam commented 6 years ago

I installed it by pip.

I try again as non root user and installing by pip but I got those errors yet!

I think there are some problems in 'SignalDecomposition.py', cause other files imported correctly but whet it try to import "SignalDecomposition"...

antoinecarme commented 6 years ago

travis-ci autoamted tests seem OK today :

https://travis-ci.org/antoinecarme/pyaf

It is using the follwing versions :

0.81s$ python ./tests/bugs/issue_36/display_version_info.py

[('matplotlib_version', '2.1.0'), ('numpy_version', '1.13.3'), ('pandas_version', '0.21.0'), ('pydot_version', '1.2.3'), ('python_implementation', 'CPython'), ('python_version', '3.6.3'), ('scipy_version', '1.0.0'), ('sklearn_version', '0.19.1'), ('sqlalchemy_version', '1.1.15'), ('system_platform', 'Linux-4.9.6-040906-generic-x86_64-with-debian-jessie-sid'), ('system_processor', 'x86_64'), ('system_uname', uname_result(system='Linux', node='travis-job-antoinecarme-pyaf-309054444.travisci.net', release='4.9.6-040906-generic', version='#201701260330 SMP Thu Jan 26 08:32:10 UTC 2017', machine='x86_64', processor='x86_64'))]

it also uses 3.6 python, can you please update your python (3.4 is quite old) ?

antoinecarme commented 6 years ago

Just a question, can you please check if you have an old version lying around ? when installed using pip, pyaf is copied in a directory $HOME/.local/lib/python3.6/site-packages/pyaf and not in $HOME/pyaf.

justmisam commented 6 years ago

Thanks, It's ok with python 3.6! 🤔

For other people that may have this problem:

I removed all other python3 packages: apt-get remove python3*

Add this line to "/etc/apt/sources.list": deb http://ftp.de.debian.org/debian testing main

Install python 3.6: apt-get -t testing install python3.6

Install pip3: apt-get install python3.6-pip

Install the requirements: pip3 install scipy pandas sklearn matplotlib pydot dill pathos sqlalchemy

Install pyaf: pip3 install --upgrade git+git://github.com/antoinecarme/pyaf.git

And everything is OK!

antoinecarme commented 6 years ago

Glad to see that\s OK. Thank you on behalf of Debian users.

Enjoy!!!