I'm having troubles getting pybrain working through anaconda
Asked Answered
D

1

7

Here is my problem:

After I managed to install anaconda (having python 3.4), I apparently managed to install pybrain too. But when i use 'import pybrain' from anaconda or from the terminal too I get this error:

>>> import pybrain
Traceback (most recent call last):

File "<ipython-input-2-0fb7233d2a8c>", line 1, in <module>
import pybrain

 File "//anaconda/lib/python3.4/site-packages/PyBrain-0.3-py3.4.egg/pybrain/__init__.py", line 1, in <module>
from structure.__init__ import *

 ImportError: No module named 'structure'
Deity answered 13/10, 2014 at 15:35 Comment(10)
I think it begs asking, how did you install pybrain? Did you use pip install pybrain or conda install pybrain? I'm assuming it's in the correct location based on the traceback, but this might be a case of incomplete dependencies or somesuch.Kith
Hi, actually I just followed what was explained in the site and then this procedure to get setuptools: pypi.python.org/pypi/setuptoolsDeity
is there any way to recover or fix the dependencies?Deity
I believe you're using a version of Pybrain that's not ported for Python 3. In particular, you need at least this commit: github.com/pybrain/pybrain/commit/….Steffens
Thank you very much. I downloaded the last version of pybrain so I thought it would work. Anyway, what should I do with what you posted exactly? (sorry for the lack of experience)Deity
You could try by: 1) removing //anaconda/lib/python3.4/site-packages/PyBrain-0.3-py3.4.egg/. 2) Downloading and extracting from github.com/pybrain/pybrain/archive/master.zip, and then installing from that.Steffens
Thank you again. By 'installing' do you mean that I should substitute pybrain.egg with the other that I downloaded?Deity
All right, I modified all the strings following these corrections (github.com/pybrain/pybrain/commit/…) and it finally works!!! The only problem is that I have to use every time this command: 'export PYTHONPATH=$PYTHONPATH:'. Does anybody know how to launch pybrain directly from python without this command?Deity
Ok, now I feel I'm very close. If I open pybrain from the terminal after having specified the PYTHONPATH it works. But when I open Python through anaconda in order to run what I write I get the message 'no module pybrai' as if anaconda couldn't see that pybrain is installed. Please help!!!Deity
I meant that you download and extract the zip file, then cd to the new directory, and type python setup.py install. Before you do that though, you need to remove the old installed files (that was the first step in my instructions).Steffens
H
8

Simply running sudo pip3 install git+https://github.com/pybrain/pybrain.git worked for me after having the same issue.

The version up on PyPi isn't Python 3 compatible. Installing the latest commit directly using pip3 should take care of your old package (from PyPi) as well.

Hardwood answered 18/12, 2014 at 15:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.