4

I need to install Pillow using easy_install or from source. Due to the restrictions on the computer I'm using at school, I can't access python.org or pip.

I decompressed the file from effbot.org, and put the PIL folder from that into site-packages. It complains that the _imaging C module isn't installed. How can I install Pillow using easy_install or from source?

Luke Taylor
  • 8,631
  • 8
  • 54
  • 92
  • What OS do you have in your school? – Aleksandr Kovalev May 28 '15 at 21:28
  • Computers in my school are all running Windows 7 – Luke Taylor May 28 '15 at 21:29
  • Have you tried `python setup.py install`? – Aleksandr Kovalev May 28 '15 at 21:31
  • 3
    *Due to the restrictions on the computer at school I'm using, I can't access python.org* your school blocks the site that has high quality documentation of a language used by millions of people, many of which are students - who are, of course, in it to learn? That makes me sad – Tim May 28 '15 at 21:32
  • They have filters that try to block sites labeled as "shareware and freeware" – Luke Taylor May 28 '15 at 21:35
  • @AlexanderKovalev How can I do this from within python, I don't believe the computer recognizes my portable python installation from the command line – Luke Taylor May 28 '15 at 21:40
  • @TimCastelijns: I'm not the least bit surprised at that. There are schools where students get disciplined for "hacking" if they so much as change the desktop background. – Kevin May 28 '15 at 21:41
  • @Kevin oh totally, I couldn't use computers in school for a month after installing google chrome. WE ONLY HAVE INTERNET EXPLORER!!! – Luke Taylor May 28 '15 at 21:42
  • What version of Python are we looking at? You might try `python -m ensurepip` if you have 3.4+. – Kevin May 28 '15 at 21:42
  • 1
    @LukeTaylor You should explicitly use your python interpreter `D:\python2\python.exe setup.py install` – Aleksandr Kovalev May 28 '15 at 21:44
  • Is there a reason you don't want to use portable python (http://portablepython.com). It comes with PIL installed. – clockwatcher May 28 '15 at 21:52
  • If you installed from source, you'd probably face the issue that you'd need a c compiler to build some of Pillow. I don't think this could work. – Paul Rooney May 28 '15 at 21:56
  • I am using portable python, clockwatcher, I uninstalled due to the same _Imaging-C module issue – Luke Taylor May 28 '15 at 21:57
  • I think you need to turn this back on your teacher. Ask them how can I do this? Surely your task is to learn programming, not how to install packages under some set of severe restrictions. If the teacher does not know how can they expect you to do it? – Paul Rooney May 28 '15 at 21:59
  • @LukeTaylor We are talking about the 2.7.6.1 portablepython at http://portablepython.com, correct? Because just double-checked and the PIL installed with that build seems to be working fine for me. – clockwatcher May 29 '15 at 00:20
  • Try doing `from PIL import ImageFont`, returns an error for me. – Luke Taylor May 29 '15 at 00:22
  • from PIL import ImageFont works for me but actually trying to use a font doesn't. Looks like that build wasn't built with freetype support. It's easy enough to replace the version under portableperl with a binary build that does though. On a computer that does have internet access, delete the ./apps/lib/site-packages/PIL.pth and ./apps/lib/site-packages/PIL directory. Then simply run ./apps/scripts/easy_install --always-unzip pillow. – clockwatcher May 29 '15 at 01:30
  • is this cross platform? In short, can I use the PIL folder from a mac and put it into a windows machine? – Luke Taylor May 29 '15 at 16:58

1 Answers1

5

If you cannot access it in your school there are several ways you can install it.

One way would be installing the needed package on your home computer (when windows type in 'pip install [pckg-name]') you will find that package in your python folder->Lib->site-packages just copy it on some usb and paste it on school computer same path

Another way would be download the package at home (directly on pypi website would be the best) and again use usb and install it then on school computer

Also you can upload that package to some webhosts (if you do not have your own domain/webspace) and use that link on your school computer in your ide or python settings as an alternative to get packages from

Or you ask some of your teachers whatever.

There are many ways to get packages installed without internet access. You can also google that e.g. 'how to install pypi packages without internet access'

Edit

http://pillow.readthedocs.org/installation.html

Community
  • 1
  • 1
Tom-Oliver Heidel
  • 1,011
  • 9
  • 25
  • if you need further infortmation tell me. by the way there are about 5-6 stackoverflow topics about installing PIL on windows. in some you can find precompiled builds. – Tom-Oliver Heidel May 28 '15 at 22:22