<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 26, 2013 at 9:46 AM, Dinesh B Vadhia <span dir="ltr"><<a href="mailto:dineshbvadhia@hotmail.com" target="_blank">dineshbvadhia@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>



<div style="PADDING-LEFT:10px;PADDING-RIGHT:10px;PADDING-TOP:15px" name="Compose message area">
<div><font face="Garamond" size="4">@ Ralf.  I missed info.py at the top and it 
is a valid statement.</font></div>
<div><font face="Garamond" size="4"></font> </div>
<div><font face="Garamond" size="4">@ Brad.  My project is using Numpy and 
Scipy and falls over at this point when using PyInstaller.  One of the 
project source files has an "import random" from the Standard Library.  As 
you say, at this point in tempfile.py, it is attempting to "import random" from 
the Standard Library but instead is importing the one from Numpy 
(numpy.random).  </font><font face="Garamond" size="4">How can this be 
fixed?  Or, is it something for PyInstaller to fix?  Thx.</font></div></div></blockquote><div><br></div><div>Probably the latter. Check your PYTHONPATH is not set and you're not doing anything to sys.path somehow. Then probably best to ask on the PyInstaller mailing list. <br>
<br></div><div>Ralf<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="PADDING-LEFT:10px;PADDING-RIGHT:10px;PADDING-TOP:15px" name="Compose message area">

<div><font face="Garamond" size="4"></font> </div>
<div><font face="Garamond" size="4"></font> </div>
<div style="FONT:10pt Tahoma">
<div><br></div>
<div style="BACKGROUND:#f5f5f5">
<div><b>From:</b> <a title="brad.froehle@gmail.com" href="mailto:brad.froehle@gmail.com" target="_blank">Bradley M. Froehle</a> </div>
<div><b>Sent:</b> Monday, March 25, 2013 1:26 PM</div>
<div><b>To:</b> <a title="mailto:numpy-discussion@scipy.org
CTRL + Click to follow link" href="mailto:numpy-discussion@scipy.org" target="_blank">Discussion of Numerical Python</a> 
</div>
<div><b>Subject:</b> Re: [Numpy-discussion] variables not defined in 
numpy.random__init.py__ ?</div></div></div><div><div class="h5">
<div><br></div>
<div dir="ltr">On Mon, Mar 25, 2013 at 12:51 PM, Ralf Gommers <span dir="ltr"><<a title="mailto:ralf.gommers@gmail.com
CTRL + Click to follow link" href="mailto:ralf.gommers@gmail.com" target="_blank">ralf.gommers@gmail.com</a>></span> wrote:<br>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
  <div dir="ltr"><span style="COLOR:rgb(80,0,80)">On Mon, Mar 25, 2013 at 4:23 
  PM, Dinesh B Vadhia </span><span style="COLOR:rgb(80,0,80)" dir="ltr"><<a title="mailto:dineshbvadhia@hotmail.com
CTRL + Click to follow link" href="mailto:dineshbvadhia@hotmail.com" target="_blank">dineshbvadhia@hotmail.com</a>></span><span style="COLOR:rgb(80,0,80)"> wrote:</span><br>
  <div class="gmail_extra">
  <div class="gmail_quote">
  <div>
  <div>
  <blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"><u></u>
    <div style="PADDING-LEFT:10px;PADDING-RIGHT:10px;PADDING-TOP:15px" name="Compose message area">
    <div><font face="Garamond" size="4">Using PyInstaller, the following error 
    occurs:</font></div>
    <div><font face="Garamond" size="4"></font> </div>
    <div><font face="Garamond" size="4">Traceback (most recent call last):<br>  
    File "<string>", line 9, in <module><br>  File 
    "//usr/lib/python2.7/dist-packages/PIL/Image.py", line 355, in 
    init<br>    __import__(f, globals(), locals(), [])<br>  
    File "//usr/lib/python2.7/dist-packages/PIL/IptcImagePlugin.py", line 23, in 
    <module><br>    import os, tempfile<br>  File 
    "/usr/lib/python2.7/tempfile.py", line 34, in 
    <module><br>    from random import Random as 
    _Random<br>  File 
    "//usr/lib/python2.7/dist-packages/numpy/random/__init__.py", line 90, in 
    <module><br>    ranf = random = sample = 
    random_sample<br>NameError: name 'random_sample' is not defined</font></div>
    <div><font face="Garamond" size="4"></font> </div>
    <div><font face="Garamond" size="4">Is line 90 in __init.py__ 
    valid?</font></div></div></blockquote>
  <div><br></div></div></div>
  <div>It is. </div></div></div></div></blockquote>
<div><br></div>
<div>In my reading of this the main problem is that `tempfile` is trying to 
import `random` from the Python standard library but instead is importing the 
one from within NumPy (i.e., `numpy.random`).  I suspect that somehow 
`sys.path` is being set incorrectly --- perhaps because of the `PYTHONPATH` 
environment variable.</div>
<div><br></div>
<div>-Brad</div></div></div></div></div></div></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div></div>