How to deal with multiple version of Theano?

712 views
Skip to first unread message

乔睿

unread,
Nov 12, 2015, 5:13:25 PM11/12/15
to lasagne-users
Hi, 

I've been using Lasagne for a while, thank you for developing this amazing package.

Now I am trying to install Lasagne on a high performance server. The server has installed an old version of Theano so I installed the latest version in my own directory and it works fine. But when I install Lasagne it seems to have troubles finding the latest version of Theano. So when I try to import I get this:

>>> import theano

>>> theano.__version__

'0.7.0.dev-ecd9dc0ba6fa70b7f65c6de620c21e502c414c5e'

>>> import lasagne

Traceback (most recent call last):

 
File "<stdin>", line 1, in <module>

 
File "lasagne/__init__.py", line 17, in <module>

   
raise ImportError("Your Theano version is too old." + install_instr)

ImportError: Your Theano version is too old.


Please make sure you install a recent enough version of Theano. Note that a

simple
'pip install theano' will usually give you a version that is too old

for Lasagne. See the installation docs for more details:

http
://lasagne.readthedocs.org/en/latest/user/installation.html#theano



I only have write permission in my own directory so I can't uninstall the old version of Theano. Is there a way to specify the right version of Theano that Lasagne should use when installing?




Kyle McDonald

unread,
Nov 12, 2015, 5:23:25 PM11/12/15
to lasagn...@googlegroups.com
I am working in a similar environment where Theano is pre-installed, but I want to update it and use it with Lasagne.

To do this, I just undefine PYTHONPATH before doing anything. For example:

> virtualenv lasagne
> source lasagne/bin/activate
> PYTHONPATH=

In my situation, undefining PYTHONPATH is the fastest way to make sure pip isn't looking at any of the preinstalled packages, just the ones in the virtual environment.

There's probably a better way that doesn't leave the PYTHONPATH mangled after running `deactivate`, but I couldn't get it working by modifying the `activate` script so I just do this in a `screen` session :)

--
You received this message because you are subscribed to the Google Groups "lasagne-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lasagne-user...@googlegroups.com.
To post to this group, send email to lasagn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lasagne-users/748d23e8-4987-41f7-b048-68302d8ffe8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

goo...@jan-schlueter.de

unread,
Nov 13, 2015, 6:41:17 AM11/13/15
to lasagne-users
Instead of checking `theano.__version__`, you should check `theano.__file__`. This will tell you where it imported Theano from. If it's not your home directory, check `sys.path`. Probably the system-wide path (e.g., `/usr/local/python2.7/dist-packages`) is listed before your local one (`/home/.../.local/lib/python2.7/site-packages`). Check if there is any `*.pth` file in `~/.local/lib/python2.7/site-packages` that lists `/usr/local/python2.7/dist-packages` and remove that line to make sure it doesn't take precedence over your home directory. Hope this helps!

Ray

unread,
Nov 14, 2015, 11:52:40 AM11/14/15
to lasagne-users
This way should work, and I think this will automatically install numpy by pip. In my case it may cause numpy link to the wrong BLAS package.

Really Thanks for replying!

在 2015年11月12日星期四 UTC-5下午5:23:25,Kyle McDonald写道:

Ray

unread,
Nov 14, 2015, 11:53:55 AM11/14/15
to lasagne-users, goo...@jan-schlueter.de
Thanks a lot!!

problem solved now

在 2015年11月13日星期五 UTC-5上午6:41:17,goo...@jan-schlueter.de写道:
Reply all
Reply to author
Forward
0 new messages