Question

Preface: I'm pretty new to CLI and Python, know nearly nothing about Canopy, and haven't been able to search my way out of this problem.

Trying to install lxml (required for a class assignment) via pip, and Canopy errors saying it can't find the xslt-config command, but continues. Later it really chokes/locks on error of not finding Visual Studio 2008, but offers 'Try MinGW as a work around'. Their suggested command returns a 'can't find setup.py' error, and I can't figure out where MinGW is located to \look in that directory.

TL;DR - lxml install seems to fail due to xslt-config problem, b/c Canopy wants Visual Studio 2008 after that. Please help me get lxml working.

Initial chunk of the terminal response follows:

Downloading lxml-3.3.5.tar.gz (3.5Mb): 3.5Mb downloaded
Running setup.py egg_info for package lxml
Building lxml version 3.3.5.
Building without Cython.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
* make sure the development packages of libxml2 and libxslt are installed *

The code goes thru that a couple times/variations, then continues and copies a number of things until it gets to this chunk:

running build_ext
building 'lxml.etree' extension
C:\Users\Owninator\AppData\Local\Enthought\Canopy32\App\appdata\canopy-1.4.0.193
8.win-x86\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: '
bugtrack_url'

warnings.warn(msg)

error: Could not find Visual Studio 2008 in your path.

It offers

To use the MinGW compiler to build an extension module, use
the '-c' flag, e.g.:
python setup.py build_ext -c mingw64

However, when I install MinGW and use that command, I get an error that it can't find setup.py.

Was it helpful?

Solution

By far the easiest way to install lxml in Canopy is to use the package manager. It is accessible from the welcome screen, or from the Tools > Package manager menu entry. Make sure you have "Available packages" selected on the menu to the left of the package manager and in the search box, type lxml. It will give you a little button to install it.

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