[Numpy-discussion] variables not defined in numpy.random __init.py__ ?

Ralf Gommers ralf.gommers@gmail....
Mon Mar 25 14:51:13 CDT 2013


On Mon, Mar 25, 2013 at 4:23 PM, Dinesh B Vadhia
<dineshbvadhia@hotmail.com>wrote:

> **
> Using PyInstaller, the following error occurs:
>
> Traceback (most recent call last):
>   File "<string>", line 9, in <module>
>   File "//usr/lib/python2.7/dist-packages/PIL/Image.py", line 355, in init
>     __import__(f, globals(), locals(), [])
>   File "//usr/lib/python2.7/dist-packages/PIL/IptcImagePlugin.py", line
> 23, in <module>
>     import os, tempfile
>   File "/usr/lib/python2.7/tempfile.py", line 34, in <module>
>     from random import Random as _Random
>   File "//usr/lib/python2.7/dist-packages/numpy/random/__init__.py", line
> 90, in <module>
>     ranf = random = sample = random_sample
> NameError: name 'random_sample' is not defined
>
> Is line 90 in __init.py__ valid?
>

It is.

Above the failing you see a line "from info import __all__", and in
random/info.py you'll see that `random_sample` is in the __all__ dict.
Somehow it disappeared for you, you'll need to do some debugging to find
out why.

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130325/e5c45b0c/attachment.html 


More information about the NumPy-Discussion mailing list