Thanks that was a silly mistake of mine. Renaming that file did the trick

On Tuesday, 2 August 2016 05:54:06 UTC+1, Pascal Lamblin wrote:
>
> The issue is not within theano, it is that you named a file in the 
> current directory "new.py", which interferes with the one imported from 
> scipy. 
>
> If you rename that file to something else, it should work. 
>
> On Mon, Aug 01, 2016, Lien Hoang wrote: 
> > Theano was working fine for me but today I got this error when I tried 
> to 
> > compile my script: 
> > 
> > Traceback (most recent call last): 
> > >   File "lstm.py", line 13, in <module> 
> > >     import theano 
> > >   File 
> > > "/home/lh/anaconda2/lib/python2.7/site-packages/theano/__init__.py", 
> line 
> > > 76, in <module> 
> > >     from theano.scan_module import scan, map, reduce, foldl, foldr, 
> clone 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/theano/scan_module/__init__.py",
>  
>
> > > line 40, in <module> 
> > >     from theano.scan_module import scan_opt 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/theano/scan_module/scan_opt.py",
>  
>
> > > line 59, in <module> 
> > >     from theano import tensor, scalar 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/theano/tensor/__init__.py", 
> > > line 6, in <module> 
> > >     from theano.tensor.basic import * 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/theano/tensor/basic.py", 
> > > line 17, in <module> 
> > >     from theano.tensor import elemwise 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/theano/tensor/elemwise.py", 
> > > line 13, in <module> 
> > >     from theano import scalar 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/theano/scalar/__init__.py", 
> > > line 4, in <module> 
> > >     from .basic_scipy import * 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/theano/scalar/basic_scipy.py",
>  
>
> > > line 16, in <module> 
> > >     import scipy.stats 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/scipy/stats/__init__.py", 
> > > line 338, in <module> 
> > >     from .stats import * 
> > >   File 
> > > "/home/lh/anaconda2/lib/python2.7/site-packages/scipy/stats/stats.py", 
> line 
> > > 183, in <module> 
> > >     from . import distributions 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/scipy/stats/distributions.py",
>  
>
> > > line 10, in <module> 
> > >     from ._distn_infrastructure import (entropy, rv_discrete, 
> > > rv_continuous, 
> > >   File 
> > > 
> "/home/lh/anaconda2/lib/python2.7/site-packages/scipy/stats/_distn_infrastructure.py",
>  
>
> > > line 44, in <module> 
> > >     from new import instancemethod 
> > >   File "/home/lh/Documents/new.py", line 5, in <module> 
> > >     import theano.tensor as T 
> > > AttributeError: 'module' object has no attribute 'tensor' 
> > > 
> > 
> > 
> > I've tried to do the set up for anaconda and theano again (pip install 
> > theano) but it did not fix the problem. Has anyone encountered and fixed 
> > this issue previously? 
> > 
> > -- 
> > 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups "theano-users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
> -- 
> Pascal 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to