Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 245
mnordber Avatar asked Mar 06 '15 09:03

mnordber


3 Answers

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.

like image 138
Liz Avatar answered Nov 18 '22 09:11

Liz


I encountered the same problem. I am working on Windows 8, 64 bit machine, with WinPython.

As every newbie would do. I install pip and then installed pybrain (or PyBrain, doesn't make difference).

After I tried to see if its working like this :

 import pybrain

I got an error saying :

There is no module named "Structures".

When I checked the site-packages, it was there.

I tried the following approaches :

  1. I tried reinstalling Structures.
  2. I tried using pip3 instead of pip.
  3. I tried pip3 install pybrain --upgrade
  4. I downloaded the .zip file of the entire project from github here and after unzipping it, went inside it from cmd and did python setup.py install.

The 4th approach worked like a charm.

Cheers.

like image 3
Pragyaditya Das Avatar answered Nov 18 '22 08:11

Pragyaditya Das


What I have done as following and it works. (windows 7, anaconda3 installed)

  1. Download ZIP file from https://github.com/pybrain/pybrain
  2. Extract the zip file and try python setup.py install
  3. Open anaconda command and run conda update conda
like image 2
Duong Trung Nghia Avatar answered Nov 18 '22 08:11

Duong Trung Nghia