How to install aggdraw with Python 2.7

I would like to use aggdraw with Python 2.7. (Is this a dumb idea anyway? I saw a good aggdraw example, but I don't want to go back to Python 2.6. Is there an equivalent drawing library working with Python 2.7?) I have Python 2.7.8 64bit installed on Windows 7 Enterprise SP 1 64 bit.

The installer at http://www.effbot.org/downloads#aggdraw complains about the lack of Python 2.6, and python setup.py install complains about the lack of vcvarsall.bat .

So, following all the related posts here, I installed the MS compiler from http://www.microsoft.com/en-us/download/details.aspx?id=44266 . It appears in the Programs and Features list, and now I have vcvarsall.bat in C:\Users\d031475\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0 .

However, python setup.py install does not work directly in CMD or on the command line of MS Visual... Compiler for Python 2.7 , which appeared on my Start menu. He still complains about the lack of vcvarsall.bat .

EDIT: even when I add the appropriate directory to my path so that I can run vcvarsall.bat from the command line, python setup.py install still complains that it cannot find it. How strange is that?

+5
source share
2 answers

To create using "Microsoft Visual C ++ Compiler for Python 2.7" you need to use setuptools> = 6.0 instead of distutils. Try changing the line from distutils.core import setup, Extension in setup.py to from setuptools import setup, Extension .

You need to create against freetype library in order to enable text rendering.

The aggdraw project seems to be abandoned. The latest version 1.2a3 is from the beginning of 2006 and precedes Python 2.7, 64 bit and Pillow. Expect a crash, especially on 64 bit for Windows.

Unofficial Windows binaries for aggdraw are available at http://www.lfd.uci.edu/~gohlke/pythonlibs/#misc .

An alternative to aggdraw is pycairo ( Windows binaries ).

+3
source

Do not try to deal with compiler tools yourself.

The easiest and most proven solution is to load into your environment suitable for Windows Binaries for aggdraw: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Once you run it in cmd in your download folder and install using pip (use the file name of the just downloaded whl script.

 pip install aggdraw-1.2a3-cp27-none-win32.whl 

DONE!

+2
source

Source: https://habr.com/ru/post/1207442/


All Articles