[Plone-Users] Error Install Python Image Library -Python.h: No such file or directory

75 views
Skip to first unread message

Simon Richardson

unread,
Mar 21, 2012, 6:44:34 PM3/21/12
to plone...@lists.sourceforge.net
I have been trying to setup a development environment following the Professional Plone 4 Development book.

I've created an isolated python environment:
$ wget http://python-distribute.org/distribute_setup.py
$ sudo python distribute_setup.py
$ sudo easy_install -U virtualenv

And followed instructions to Install the Python Image Library
$ wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
$ gtar -zxvf Imaging-1.1.7.tar.gz
$ cd Imaging-1.1.7
$ ~/plone-python/bin/python setup.py install

Which fails.  Output from this is shown below.  I googled
"Python.h: No such file or directory" and learned that this was missing because I don't have Python-dev installed.  But as I'm new to Python and Plone I don't know how to install Python-dev into my Python install at ~/plone-python/.  Any help with this would be appreciated.

running install
running build
running build_py
running build_ext
building '_imaging' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -IlibImaging -I/home/plone/plone-python/include -I/usr/local/include -I/usr/include -I/usr/include/python2.6 -c _imaging.c -o build/temp.linux-x86_64-2.6/_imaging.o
_imaging.c:75:20: error: Python.h: No such file or directory


Thanks

Simon




Raphael Ritz

unread,
Mar 21, 2012, 6:52:59 PM3/21/12
to plone...@lists.sourceforge.net
On 3/21/12 11:44 PM, Simon Richardson wrote:
I have been trying to setup a development environment following the Professional Plone 4 Development book.

What OS are you on?

On Debian/Ubuntu you want to do

  sudo apt-get install python-dev

irrespective of your virtualenv.

HTH

    Raphael

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure


_______________________________________________
Plone-Users mailing list
Plone...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users

David Bear

unread,
Mar 21, 2012, 9:32:21 PM3/21/12
to Simon Richardson, plone...@lists.sourceforge.net
2012/3/21 Simon Richardson <claretn...@googlemail.com>
You may also want to install build-essentials if you are on ubuntu in addition to the python-dev libraries. Also, make sure if you are using a system python that it is the correct version for plone. 

You may want to use the unified installer instead since that will build you a known-good python with most everything else you'll need. 


 

Thanks

Simon





------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Plone-Users mailing list
Plone...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users




--
David Bear
College of Public Programs at ASU
602-496-0424

Simon Richardson

unread,
Mar 22, 2012, 2:27:12 PM3/22/12
to plone...@lists.sourceforge.net
I have tried Unified Installer and it puts the python header files in the plone/python install on my home directory.  I just wondered if there was something which allow me to do this without using the Unified Installer.  I'm trying to follow the Prof Plone 4 Dev book and Martin Aspeli doesn't use the Unified Installer to setup his development environment.

I'm going to take a look at yum to see if I can change the destination directory.  Will let you know how I get on.

Simon

On 22/03/2012 07:24, Noe Nieto wrote:
I'm not sure, but last time I installed python from sources, it already new where to find the python headers.

Have you tried the unified installer?

--
Noe

2012/3/22 Simon Richardson <claretn...@googlemail.com>
Thanks Noe

If I use yum it will install to my system python directory and not the local one which I have prepared in my home directory.  Is there a way of install to my local directory.

Simon


On 21/03/2012 22:53, Noe Nieto wrote:
You need to install the Python development libraries.

python-dev in debian systems.
python-devel in Redhat-like systems.


2012/3/21 Simon Richardson <claretn...@googlemail.com>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Plone-Users mailing list
Plone...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users




--
---
Noe Nieto
NNieto Consulting Services
M: nni...@noenieto.com
W: http://noenieto.com
T:  @tzicatl
Li: Perfil en LinkedIn





--
---
Noe Nieto
NNieto Consulting Services
M: nni...@noenieto.com
W: http://noenieto.com
T:  @tzicatl
Li: Perfil en LinkedIn


Raphael Ritz

unread,
Mar 22, 2012, 4:09:18 PM3/22/12
to plone...@lists.sourceforge.net
On 3/22/12 7:27 PM, Simon Richardson wrote:
I have tried Unified Installer and it puts the python header files in the plone/python install on my home directory.  I just wondered if there was something which allow me to do this without using the Unified Installer.  I'm trying to follow the Prof Plone 4 Dev book and Martin Aspeli doesn't use the Unified Installer to setup his development environment.

I'm going to take a look at yum to see if I can change the destination directory. 

Not sure what you are trying to achieve but is usually sufficient
to install those packages system wide using your OS's packaging
system. Before you build your Plone that is.

See http://plone.org/documentation/manual/installing-plone/installing-on-linux-unix-bsd/debian-libraries
for what you should consider including.
All those packages are available on other Linux distributions as
well but might be called slightly differently there.

HTH

    Raphael

David Bear

unread,
Mar 22, 2012, 4:57:10 PM3/22/12
to Simon Richardson, plone...@lists.sourceforge.net
Using the unified installer you can select the destination for the entire python/zope/plone buildout, including the dev libs.  

Yum will likely be a dead end because if you use a repository, the destinations are going to be hard wired in to the rpm. See the startup options:

--target=pathname
  Use to specify top-level path for installs. Plone instances
  and Python will be built inside this directory
  (default is /home/iddwb/Plone)

--instance=instance-name
  Use to specify the name of the operating instance to be created.
  This will be created inside the target directory unless there's
  a slash in the specification.
  Default is 'zinstance' for standalone, 'zeocluster' for ZEO.


2012/3/22 Simon Richardson <claretn...@googlemail.com>



--

Dieter Maurer

unread,
Mar 24, 2012, 4:08:51 AM3/24/12
to Simon Richardson, plone...@lists.sourceforge.net
Simon Richardson wrote at 2012-3-22 18:27 +0000:
>I have tried Unified Installer and it puts the python header files in
>the plone/python install on my home directory. I just wondered if there
>was something which allow me to do this without using the Unified
>Installer.

The unified installer tries here to avoid problems which have occurred
several times in the past (missing installations of development packages)
in order that people with less operating system experience can
play with Plone (and do not get strange (for them) problem messages).

While it has obvious advantages (newbies can play with Plone),
it comes with its disadvantages in real production sites.
For example, the libraries installed in this way will not
be updated when serious security issues should have been found.

If you have operating system experience, install the required development
packages via your operating system's packaging system --
otherwise, use the UnifiedInstaller.
In my view, it is not very advantages to do something in between.

--
Dieter

Reply all
Reply to author
Forward
0 new messages