No module named 'structure' when installing PyBrain even though it's in the folder

mnordber picture mnordber · Mar 6, 2015 · Viewed 14.6k times · Source

I installed PyBrain via PyCharm and when I try to compile I get the following error:

Traceback (most recent call last):
  File "C:/Users/Marcus/PycharmProjects/ANN/ann.py", line 2, in <module>
    from pybrain.tools.shortcuts import buildNetwork
  File "C:\Python34\lib\site-packages\pybrain\__init__.py", line 1, in <module>
    from structure.__init__ import *
ImportError: No module named 'structure'

However, in the folder site-packages\pybrain\ there's a folder named 'structure' with (what I assume is) what pybrain is asking for.

enter image description here

I'm pretty new to Python so I'm not completely used to this installing packages thing. Is it something that I missed? I have tried to search for a package named "structure" in the PyCharm package installer but there is none (only a 'structures').

Thanks in advance

EDIT: A comment asked me to further explain how I installed the package. In PyCharm, I went to project settings -> project interpreter -> search for "pybrain"

enter image description here

Answer

Liz picture Liz · Dec 5, 2016

I was having the same problem and tried all the suggestions mentioned here. Finally I realized that the version that was installing was 0.3.1, and it is not compatible with Python 3. So I deleted that version and then ran !pip install https://github.com/pybrain/pybrain/archive/0.3.3.zip(from Spyder ipython console). This finally worked.