ImportError: No module named pylearn2

1,409 views
Skip to first unread message

jake.k...@gmail.com

unread,
Mar 29, 2014, 3:58:11 PM3/29/14
to pylear...@googlegroups.com
So I tried to follow the tutorial and didn't have any success.
When I tried to run the command

python -c "import pylearn2"

I end up with the error prompt

Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named pylearn2

I searched around online and found several different suggested methods on fixing this issue. I've tried them and combinations of them to get it fixed. As of right now my .bashrc contains this

#Add pylearn2 Path
PYLEARN2=/usr/local/lib/python2.7/dist-packages/pylearn2.0.1dev-py2.7.egg/pylearn2
PYTHONPATH=/usr/local/lib/python2.7
export PYTHONPATH=$PYLEARN2:$PYTHONPATH

Anyone have any ideas on what I'm doing wrong here?

Frédéric Bastien

unread,
Mar 31, 2014, 8:20:36 PM3/31/14
to pylear...@googlegroups.com
How did you install pylearn2?

Here is the current installation instruction:
http://deeplearning.net/software/pylearn2/#download-and-installation

The installation procedure changed recently.

Frédéric
> --
> You received this message because you are subscribed to the Google Groups "pylearn-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylearn-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

jake.k...@gmail.com

unread,
Apr 5, 2014, 1:59:26 PM4/5/14
to pylear...@googlegroups.com, no...@nouiz.org
I used the github clone just like it shows on the site

So in the .bashrc file it should just be
export PYLEARN2_DATA_PATH=/usr/local/lib/python2.7/dist-packages/pylearn2.0.1dev-py2.7.egg/pylearn2

It still prompts with the same error. Is it suppose to be in a specific location in the .bashrc file?

Ian Goodfellow

unread,
Apr 5, 2014, 5:11:12 PM4/5/14
to pylear...@googlegroups.com, no...@nouiz.org
It's kind if weird that your egg files are not just on the path already. You want your PYTHONPATH to contain $FOO
where $FOO/pylearn2/__init__.py exists. Can you verify that with ls?


--
Sent from Gmail Mobile

jake.k...@gmail.com

unread,
Apr 5, 2014, 5:33:54 PM4/5/14
to pylear...@googlegroups.com, no...@nouiz.org
I just did a complete fresh install of Ubuntu and got all the dependencies again so I can start from scratch.

The github clone put pylearn2 at the location /home/jake/pylearn2 and the __init__.py file is in the folder /home/jake/pylearn2/pylearn2.

When I run ls "$PYTHONPATH" it shows all the files inside that folder, so $PYTHONPATH is pointing there, yet I still get the module not found error when I run python -c "import pylearn2"

Ian Goodfellow

unread,
Apr 5, 2014, 5:37:21 PM4/5/14
to pylear...@googlegroups.com, no...@nouiz.org
PYTHONPATH should be /home/jake/pylearn2
--
You received this message because you are subscribed to the Google Groups "pylearn-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylearn-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jake.k...@gmail.com

unread,
Apr 5, 2014, 5:42:29 PM4/5/14
to pylear...@googlegroups.com, no...@nouiz.org

Odd. I had actually tried that in one attempted. But seems to be working now. That just seems to be my luck with these types of things.
But python is importing it now so I'm good. Thanks for the help.

Reply all
Reply to author
Forward
0 new messages