Question

I need to install PIL 1.1.7, particularly the Image and ImageTk modules, for writing Tkinter GUI codes with Python 2.7.

When I initiated the installation, although Python 2.7 was detected in the registry, the Python and Installation Directory selected was not Python 2.7 but Panda3D-1.8.1\python. I know PIL is applicable for Panda3D as well but that's not my goal.

As far as I can tell, I cannot change the directories.

I think uninstalling Panda3D then install PIL may be an option but more of a last-resort option.

Any advice will be much appreciated. Thanks!

Was it helpful?

Solution

Read this:

What if I already have a copy of Python?

If you already have a copy of python, and you wish to use that instead of the one provided with panda, it is easy to do so.

Simply create a "panda.pth" file inside your copy of python, containing the path of the panda directory and the bin directory within it on separate lines (for example C:\Program Files\Panda3D-1.2.3 and C:\Program Files\Panda3D-1.2.3\bin).

This will enable your copy of python to find the panda libraries. For this to work, the version of python that you use must match the version of python included with panda.

The panda libraries are compiled for that particular version, and will not work with any other. Of course, if you do use your own copy of python, you may wish to delete panda's copy of python, or at least, remove it from the PATH environment variable. Otherwise, you will have two copies of python, which can lead to confusion.

Follow above instructions, and at the end after you remove path of panda's copy of python from PATH, add the path of current python to PATH, and then install PIL or Pillow again, now it should find your current python.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top