nschaetti / EchoTorch

A Python toolkit for Reservoir Computing and Echo State Network experimentation based on pyTorch. EchoTorch is the only Python module available to easily create Deep Reservoir Computing models.
https://nschaetti.github.io/echotorch.github.io/
GNU General Public License v3.0
441 stars 117 forks source link

cannot import echotorch because can't find datasets module ? #1

Closed gentr1 closed 6 years ago

gentr1 commented 6 years ago

I installed echotorch in conda on Windows 10 using "pip install " , and I have the echotorch folder in my C:\Miniconda3\lib\site-packages\ (note that my pytorch installation is working) Problem is, every time I try to just import echotorch, I am given the following error message: import echotorch Traceback (most recent call last): File "<pyshell#2>", line 1, in import echotorch File "C:\Miniconda3\lib\site-packages\echotorch__init__.py", line 5, in import datasets ModuleNotFoundError: No module named 'datasets'

That seems weird because the datasets folder has been copied during installation. Any idea ?

nschaetti commented 6 years ago

I created a new release 0.1.1 with all the last modification. I tried the NARMA example and it works well. I uploaded the new release to pyPI. Can you test it?

Regards

gentr1 commented 6 years ago

Thanks for your prompt answer, friend ! And I think your work looks incredible . Unfortunately , version 0.1.1 has the same issue. I am so sorry to bother you with something so basic as just the installation... (I am curious about how close to this fascinating paper your implementation might be : https://arxiv.org/abs/1803.04779 ) I tried: 1- installing with pip install EchoTorch from miniconda : gives me "ModuleNotFoundError: No module named 'datasets'" . So I uninstalled from pip. Then I downloaded directly the .zip file from the Github. 2- from the content of the Github .zip folder, I did python setup.py install. It did gives me all the bells and whistles that the install seems ok:

running install
running bdist_egg
running egg_info
creating EchoTorch.egg-info
writing EchoTorch.egg-info\PKG-INFO
writing dependency_links to EchoTorch.egg-info\dependency_links.txt
writing requirements to EchoTorch.egg-info\requires.txt
writing top-level names to EchoTorch.egg-info\top_level.txt
writing manifest file 'EchoTorch.egg-info\SOURCES.txt'
reading manifest file 'EchoTorch.egg-info\SOURCES.txt'
writing manifest file 'EchoTorch.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\echotorch
copying echotorch\__init__.py -> build\lib\echotorch
creating build\lib\echotorch\datasets
copying echotorch\datasets\LogisticMapDataset.py -> build\lib\echotorch\datasets
copying echotorch\datasets\MackeyGlassDataset.py -> build\lib\echotorch\datasets
copying echotorch\datasets\MemTestDataset.py -> build\lib\echotorch\datasets
copying echotorch\datasets\NARMADataset.py -> build\lib\echotorch\datasets
copying echotorch\datasets\SwitchAttractorDataset.py -> build\lib\echotorch\datasets
copying echotorch\datasets\__init__.py -> build\lib\echotorch\datasets
creating build\lib\echotorch\models
copying echotorch\models\HNilsNet.py -> build\lib\echotorch\models
copying echotorch\models\NilsNet.py -> build\lib\echotorch\models
copying echotorch\models\TNilsNet.py -> build\lib\echotorch\models
copying echotorch\models\__init__.py -> build\lib\echotorch\models
creating build\lib\echotorch\nn
copying echotorch\nn\BDESN.py -> build\lib\echotorch\nn
copying echotorch\nn\BDESNCell.py -> build\lib\echotorch\nn
copying echotorch\nn\BDESNPCA.py -> build\lib\echotorch\nn
copying echotorch\nn\EESN.py -> build\lib\echotorch\nn
copying echotorch\nn\ESN.py -> build\lib\echotorch\nn
copying echotorch\nn\ESN2d.py -> build\lib\echotorch\nn
copying echotorch\nn\ESNCell.py -> build\lib\echotorch\nn
copying echotorch\nn\GatedESN.py -> build\lib\echotorch\nn
copying echotorch\nn\HESN.py -> build\lib\echotorch\nn
copying echotorch\nn\ICACell.py -> build\lib\echotorch\nn
copying echotorch\nn\Identity.py -> build\lib\echotorch\nn
copying echotorch\nn\IncSFACell.py -> build\lib\echotorch\nn
copying echotorch\nn\LiESN.py -> build\lib\echotorch\nn
copying echotorch\nn\LiESNCell.py -> build\lib\echotorch\nn
copying echotorch\nn\OnlinePCACell.py -> build\lib\echotorch\nn
copying echotorch\nn\PCACell.py -> build\lib\echotorch\nn
copying echotorch\nn\RRCell.py -> build\lib\echotorch\nn
copying echotorch\nn\SFACell.py -> build\lib\echotorch\nn
copying echotorch\nn\StackedESN.py -> build\lib\echotorch\nn
copying echotorch\nn\UMESN.py -> build\lib\echotorch\nn
copying echotorch\nn\__init__.py -> build\lib\echotorch\nn
creating build\lib\echotorch\transforms
copying echotorch\transforms\__init__.py -> build\lib\echotorch\transforms
creating build\lib\echotorch\utils
copying echotorch\utils\error_measures.py -> build\lib\echotorch\utils
copying echotorch\utils\utility_functions.py -> build\lib\echotorch\utils
copying echotorch\utils\__init__.py -> build\lib\echotorch\utils
creating build\lib\echotorch\transforms\images
copying echotorch\transforms\images\__init__.py -> build\lib\echotorch\transforms\images
creating build\lib\echotorch\transforms\text
copying echotorch\transforms\text\Character.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\Character2Gram.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\Character3Gram.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\Compose.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\Embedding.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\FunctionWord.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\GensimModel.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\GloveVector.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\PartOfSpeech.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\Tag.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\Token.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\Transformer.py -> build\lib\echotorch\transforms\text
copying echotorch\transforms\text\__init__.py -> build\lib\echotorch\transforms\text
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\echotorch
creating build\bdist.win-amd64\egg\echotorch\datasets
copying build\lib\echotorch\datasets\LogisticMapDataset.py -> build\bdist.win-amd64\egg\echotorch\datasets
copying build\lib\echotorch\datasets\MackeyGlassDataset.py -> build\bdist.win-amd64\egg\echotorch\datasets
copying build\lib\echotorch\datasets\MemTestDataset.py -> build\bdist.win-amd64\egg\echotorch\datasets
copying build\lib\echotorch\datasets\NARMADataset.py -> build\bdist.win-amd64\egg\echotorch\datasets
copying build\lib\echotorch\datasets\SwitchAttractorDataset.py -> build\bdist.win-amd64\egg\echotorch\datasets
copying build\lib\echotorch\datasets\__init__.py -> build\bdist.win-amd64\egg\echotorch\datasets
creating build\bdist.win-amd64\egg\echotorch\models
copying build\lib\echotorch\models\HNilsNet.py -> build\bdist.win-amd64\egg\echotorch\models
copying build\lib\echotorch\models\NilsNet.py -> build\bdist.win-amd64\egg\echotorch\models
copying build\lib\echotorch\models\TNilsNet.py -> build\bdist.win-amd64\egg\echotorch\models
copying build\lib\echotorch\models\__init__.py -> build\bdist.win-amd64\egg\echotorch\models
creating build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\BDESN.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\BDESNCell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\BDESNPCA.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\EESN.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\ESN.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\ESN2d.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\ESNCell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\GatedESN.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\HESN.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\ICACell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\Identity.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\IncSFACell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\LiESN.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\LiESNCell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\OnlinePCACell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\PCACell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\RRCell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\SFACell.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\StackedESN.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\UMESN.py -> build\bdist.win-amd64\egg\echotorch\nn
copying build\lib\echotorch\nn\__init__.py -> build\bdist.win-amd64\egg\echotorch\nn
creating build\bdist.win-amd64\egg\echotorch\transforms
creating build\bdist.win-amd64\egg\echotorch\transforms\images
copying build\lib\echotorch\transforms\images\__init__.py -> build\bdist.win-amd64\egg\echotorch\transforms\images
creating build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\Character.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\Character2Gram.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\Character3Gram.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\Compose.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\Embedding.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\FunctionWord.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\GensimModel.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\GloveVector.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\PartOfSpeech.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\Tag.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\Token.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\Transformer.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\text\__init__.py -> build\bdist.win-amd64\egg\echotorch\transforms\text
copying build\lib\echotorch\transforms\__init__.py -> build\bdist.win-amd64\egg\echotorch\transforms
creating build\bdist.win-amd64\egg\echotorch\utils
copying build\lib\echotorch\utils\error_measures.py -> build\bdist.win-amd64\egg\echotorch\utils
copying build\lib\echotorch\utils\utility_functions.py -> build\bdist.win-amd64\egg\echotorch\utils
copying build\lib\echotorch\utils\__init__.py -> build\bdist.win-amd64\egg\echotorch\utils
copying build\lib\echotorch\__init__.py -> build\bdist.win-amd64\egg\echotorch
byte-compiling build\bdist.win-amd64\egg\echotorch\datasets\LogisticMapDataset.py to LogisticMapDataset.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\datasets\MackeyGlassDataset.py to MackeyGlassDataset.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\datasets\MemTestDataset.py to MemTestDataset.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\datasets\NARMADataset.py to NARMADataset.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\datasets\SwitchAttractorDataset.py to SwitchAttractorDataset.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\datasets\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\models\HNilsNet.py to HNilsNet.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\models\NilsNet.py to NilsNet.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\models\TNilsNet.py to TNilsNet.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\models\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\BDESN.py to BDESN.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\BDESNCell.py to BDESNCell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\BDESNPCA.py to BDESNPCA.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\EESN.py to EESN.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\ESN.py to ESN.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\ESN2d.py to ESN2d.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\ESNCell.py to ESNCell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\GatedESN.py to GatedESN.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\HESN.py to HESN.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\ICACell.py to ICACell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\Identity.py to Identity.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\IncSFACell.py to IncSFACell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\LiESN.py to LiESN.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\LiESNCell.py to LiESNCell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\OnlinePCACell.py to OnlinePCACell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\PCACell.py to PCACell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\RRCell.py to RRCell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\SFACell.py to SFACell.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\StackedESN.py to StackedESN.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\UMESN.py to UMESN.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\nn\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\images\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\Character.py to Character.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\Character2Gram.py to Character2Gram.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\Character3Gram.py to Character3Gram.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\Compose.py to Compose.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\Embedding.py to Embedding.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\FunctionWord.py to FunctionWord.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\GensimModel.py to GensimModel.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\GloveVector.py to GloveVector.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\PartOfSpeech.py to PartOfSpeech.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\Tag.py to Tag.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\Token.py to Token.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\Transformer.py to Transformer.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\text\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\transforms\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\utils\error_measures.py to error_measures.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\utils\utility_functions.py to utility_functions.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\utils\__init__.py to __init__.cpython-36.pyc
byte-compiling build\bdist.win-amd64\egg\echotorch\__init__.py to __init__.cpython-36.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying EchoTorch.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying EchoTorch.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying EchoTorch.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying EchoTorch.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying EchoTorch.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying EchoTorch.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
creating dist
creating 'dist\EchoTorch-0.1.1-py3.6.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing EchoTorch-0.1.1-py3.6.egg
creating c:\miniconda3\lib\site-packages\EchoTorch-0.1.1-py3.6.egg
Extracting EchoTorch-0.1.1-py3.6.egg to c:\miniconda3\lib\site-packages
Adding EchoTorch 0.1.1 to easy-install.pth file

Installed c:\miniconda3\lib\site-packages\echotorch-0.1.1-py3.6.egg
Processing dependencies for EchoTorch==0.1.1
Searching for torchvision==0.2.1
Best match: torchvision 0.2.1
Adding torchvision 0.2.1 to easy-install.pth file

Using c:\miniconda3\lib\site-packages
Searching for numpy==1.14.3
Best match: numpy 1.14.3
Adding numpy 1.14.3 to easy-install.pth file

Using c:\miniconda3\lib\site-packages
Searching for torch==0.4.0
Best match: torch 0.4.0
Adding torch 0.4.0 to easy-install.pth file

Using c:\miniconda3\lib\site-packages
Searching for Pillow==5.1.0
Best match: Pillow 5.1.0
Adding Pillow 5.1.0 to easy-install.pth file

Using c:\miniconda3\lib\site-packages
Searching for six==1.11.0
Best match: six 1.11.0
Adding six 1.11.0 to easy-install.pth file

Using c:\miniconda3\lib\site-packages
Finished processing dependencies for EchoTorch==0.1.1

After that when I try, to import echotoch from Python, it still gives me the following message:

import echotorch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\M Khoury\Documents\programming\deep_learning\EchoTorch-dev\echotorch\__init__.py", line 5, in <module>
    import datasets
ModuleNotFoundError: No module named 'datasets'
tanderberg commented 6 years ago

Just encountered the same problem. I think it's a case of "the __init__.py trap":

http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#the-init-py-trap

There are __init__.py files under echotorch (the site package root) and in all its subdirectories (datasets, models, nn, transforms, utils). That doesn't work in Python 3.3 and up. I'm on Python 3.6, and so is gentr1, as far as I can see.