I cannot install lxml
I'm quite new to Python ecosystem. I'm working on a Windows 7 Professional (x64) platform. I'm trying to install "lxml" but I failed. I've tried 3 different ways: 1) Using the lxml-3.2.3.win-amd64-py2.7.exe file at https://pypi.python.org/pypi/lxml/3.2.3 : At the very beginning of the installation process I get an error message: "Python version 2.7 required, wich was not found in the registry." and I cannot set the appropriate path. It is weird. I got Python 2.7.3 installed and set in the System PATH. I can run it from the Windows console and run several Python environments. 2) Using "pip" tool. The process fails and issues an error: "Unable to find vcvarsall.bat" 3) Using Cython, but I'm having troubles with Cython too ;-). Could you please help me with this situation? Regards. Pedro
Hi, you already asked on the Cython users list, but since this list is more appropriate (your installation issues have nothing to do with Cython), let's continue over here. Pedro Pastor, 05.09.2013 23:54:
I'm quite new to Python ecosystem.
I'm working on a Windows 7 Professional (x64) platform. I'm trying to install "lxml" but I failed. I've tried 3 different ways:
1) Using the lxml-3.2.3.win-amd64-py2.7.exe file at https://pypi.python.org/pypi/lxml/3.2.3 :
At the very beginning of the installation process I get an error message:
"Python version 2.7 required, wich was not found in the registry."
and I cannot set the appropriate path.
Not path, registry. That's a Windows specific thing. How did you install Python? There is also an alternative lxml installer at http://www.lfd.uci.edu/~gohlke/pythonlibs/ which you can try.
It is weird. I got Python 2.7.3 installed and set in the System PATH. I can run it from the Windows console and run several Python environments.
The problem is not getting it into the system PATH. You need to properly install it the proper Windows way in order to allow other Windows installers (like that of lxml) to find it. Note that your problem doesn't have much to do with Python specifically, it's a Windows installation problem.
2) Using "pip" tool. The process fails and issues an error:
"Unable to find vcvarsall.bat"
You need a C compiler to compile lxml from sources. There's MS Visual Studio Express (as Chris Barker pointed out), if you really want to go that route. I do not recommend it. Instead, fix up your Python installation and then use a binary installer for lxml. Everything else will just be too much hassle on a Windows system.
3) Using Cython, but I'm having troubles with Cython too ;-).
You do not need Cython, and I recommend not using it to install lxml. In fact, it won't be used by the installation anyway, even if it's installed. Stefan
On 09/06/2013 06:34 AM, Stefan Behnel wrote:
Hi,
you already asked on the Cython users list, but since this list is more appropriate (your installation issues have nothing to do with Cython), let's continue over here.
Pedro Pastor, 05.09.2013 23:54:
I'm quite new to Python ecosystem.
I'm working on a Windows 7 Professional (x64) platform. I'm trying to install "lxml" but I failed. I've tried 3 different ways:
1) Using the lxml-3.2.3.win-amd64-py2.7.exe file at https://pypi.python.org/pypi/lxml/3.2.3 :
At the very beginning of the installation process I get an error message:
"Python version 2.7 required, wich was not found in the registry."
and I cannot set the appropriate path.
Not path, registry. That's a Windows specific thing. How did you install Python?
There is also an alternative lxml installer at
http://www.lfd.uci.edu/~gohlke/pythonlibs/
which you can try.
It is weird. I got Python 2.7.3 installed and set in the System PATH. I can run it from the Windows console and run several Python environments.
The problem is not getting it into the system PATH. You need to properly install it the proper Windows way in order to allow other Windows installers (like that of lxml) to find it.
Note that your problem doesn't have much to do with Python specifically, it's a Windows installation problem.
2) Using "pip" tool. The process fails and issues an error:
"Unable to find vcvarsall.bat"
You need a C compiler to compile lxml from sources. There's MS Visual Studio Express (as Chris Barker pointed out), if you really want to go that route. I do not recommend it. Instead, fix up your Python installation and then use a binary installer for lxml. Everything else will just be too much hassle on a Windows system.
3) Using Cython, but I'm having troubles with Cython too ;-).
You do not need Cython, and I recommend not using it to install lxml. In fact, it won't be used by the installation anyway, even if it's installed.
Stefan
Theoretically the following should also work: c:\path_to_your_python\scripts\easy_install.exe lxml-3.2.3.win-amd64-py2.7.exe But otherwise a properly installed python is definitely the right way. Another question is whether the python you installed is 64 or 32 bit? Because that should *match* with the lxml package bits. To figure, start your python and watch for the first line: Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32 -- Best regards, Adam GROSZER -- Quote of the day: Actors will happen even in the best-regulated families.
Adam GROSZER <agroszer <at> gmail.com> writes:
But otherwise a properly installed python is definitely the right way. Another question is whether the python you installed is 64 or 32 bit? Because that should *match* with the lxml package bits.
To figure, start your python and watch for the first line: Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Thank you very much both Stephan and Adam. Not Windows but me was the culprit. Python 2.7 got installed when I installed "Pythonxy" environment. This only exist for 32-bits based systems. As far as my mechine is x64, I didn't remember that tricky point from Pythonxy and I was insisting oninstalling the x64 version of "lxml". Using the x32 lxml installer has done the work. Thank you very much again for helping me with this stupid mistake of mine ("The devil is in the details"), and sorry for pestering you. Regards. Pedro
participants (3)
-
Adam GROSZER -
Pedro Pastor -
Stefan Behnel