<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body text="#000000" bgcolor="#FFFFFF">Hi,<br>
<br>
<blockquote style="border: 0px none;"
cite="mid:201501281844.43521.even.rouault@spatialys.com" type="cite">
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="even.rouault@spatialys.com" photoname="Even Rouault"
src="cid:part1.06010103.01050806@cartodb.com"
name="compose-unknown-contact.jpg" width="25px" height="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:even.rouault@spatialys.com"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Even Rouault</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">January 28, 2015
at 6:44 PM</span></font></div></div></div>
<div style="color: rgb(136, 136, 136); margin-left: 24px;
margin-right: 24px;" __pbrmquotes="true" class="__pbConvBody"><pre wrap="">Jorge,
</pre><blockquote type="cite"><pre wrap="">I've compiled GDAL from trunk, specifying --with-python at configure
time. I first checked numpy is correctly installed. The problem is I
couldn't import gdal_array.py by default (got ImportError: no module
named _gdal_array).
Tried
python gdal_sources/swig/python/setup.py install
Didn't work.
</pre></blockquote><pre wrap=""><!---->
"didn't work", could you be more precise ?
"python setup.py install" requires root rights since it installs in
/usr/local/lib. There's a ticket&debate if the python bindings should honour
the --prefix specified at configure time or not. Currently they don't, and it is
an annoyance for folks. Perhaps we should revert to honour the prefix, but this
was disabled at some point and nobody remembers why...</pre></div>
</blockquote>
Yes, I felt the pain of python bindings don't honouring the --prefix
specified... Good to know there's a debate on this.<br>
<br>
Sorry about my vague description. I just did it using sudo, for a system
installation, and after that, system Python still didn't find the path.
So, after <br>
<br>
sudo python gdal_sources/swig/python/setup.py install <br>
<br>
I still get the same error: <br>
<br>
ImportError: no module named _gdal_array<br>
<br>
<blockquote style="border: 0px none;"
cite="mid:201501281844.43521.even.rouault@spatialys.com" type="cite">
<div style="color: rgb(136, 136, 136); margin-left: 24px;
margin-right: 24px;" __pbrmquotes="true" class="__pbConvBody"><blockquote
type="cite"><pre wrap="">I finally had to define
export PYTHONPATH=$PYTHONPATH:$/usr/local/lib/python2.7/dist-packages/osgeo
to make it work. And I don't think that's the default solution, right?
</pre></blockquote><pre wrap=""><!---->
That's what I use since I have many GDAL versions on my machine and must
switch between them without reinstalling. For regular users not tweaking the
installation prefix, "sudo make install" should do the right thing however.</pre></div>
</blockquote>
Yep, that was what I thought. But still fails after sudo make install.
The only way I've found to make it work is by exporting PYTHONPATH<br>
<br>
Best regards,<br>
<br>
Jorge<br>
<blockquote style="border: 0px none;"
cite="mid:201501281844.43521.even.rouault@spatialys.com" type="cite">
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><blockquote type="cite"><pre wrap="">Am I doing something wrong?
Environment: Ubuntu 14.10, GDAL from trunk, Python 2.7.8
</pre></blockquote><pre wrap=""><!---->
Even
</pre></div>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<div>Sent with <a href="http://www.getpostbox.com"><span style="color:
rgb(51, 102, 153);">Postbox</span></a></div></div>
</body></html>