virtualenv: installing PIL


I'm trying to install a few packages in virtualenv, which includes PIL.

This is the error I'm seeing:

copying PIL/ -> build/lib.linux-x86_64-2.7/PIL

running build_ext

sh: dpkg-architecture: not found

building '_imaging' extension

creating build/temp.linux-x86_64-2.7/libImaging

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -IlibImaging -I/home/latta/.virtualenvs/onlineenterprisementor/i nclude -I/usr/local/include -I/usr/include -I/usr/local/include/python2.7 -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o

unable to execute gcc: No such file or directory

error: command 'gcc' failed with exit status 1

Currently it's not possible to install Python modules which have any C components because there is no compiler available to user accounts (gcc is the GNU C compiler).

However, PIL is included in the host system so if you build your virtualenv with the --system-site-packages argument then you should be able to use that.