Error trying to install Cython

359 views
Skip to first unread message

Pedro Pastor

unread,
Sep 5, 2013, 12:34:20 PM9/5/13
to cython...@googlegroups.com
Hi all,

I'm quite knew to Pythion ecosystem. 
I'm trying to install Cython in a Windows 7 Professional platform. I did use [ >> pip install cython ] from an IPython console and I got a faulty installation. I also got a long pip.log file. The final lines of the log say:

==============================================

running build_ext

building 'Cython.Plex.Scanners' extension

error: Unable to find vcvarsall.bat

----------------------------------------

Command C:\Python27\python.exe -c "import setuptools;__file__='c:\\users\\pedrop~1\\appdata\\local\\temp\\pip-build\\cython\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\pedrop~1\appdata\local\temp\pip-xdudyk-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\users\pedrop~1\appdata\local\temp\pip-build\cython

Exception information:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip\basecommand.py", line 107, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip\commands\install.py", line 261, in run
    requirement_set.install(install_options, global_options)
  File "C:\Python27\lib\site-packages\pip\req.py", line 1166, in install
    requirement.install(install_options, global_options)
  File "C:\Python27\lib\site-packages\pip\req.py", line 589, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "C:\Python27\lib\site-packages\pip\util.py", line 612, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command C:\Python27\python.exe -c "import setuptools;__file__='c:\\users\\pedrop~1\\appdata\\local\\temp\\pip-build\\cython\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\pedrop~1\appdata\local\temp\pip-xdudyk-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\users\pedrop~1\appdata\local\temp\pip-build\cython

===================================

Could anybody shed some light on this problem? I need Cython in order to install "lxml" package !!

Regards.
Pedro

Stefan Behnel

unread,
Sep 5, 2013, 12:40:41 PM9/5/13
to cython...@googlegroups.com
Pedro Pastor, 05.09.2013 18:34:
> I'm quite knew to Pythion ecosystem.
> I'm trying to install Cython in a Windows 7 Professional platform. I did
> use [ >> pip install cython ] from an IPython console and I got a faulty
> installation. I also got a long pip.log file. The final lines of the log
> say:
>
> ==============================================
> running build_ext
> building 'Cython.Plex.Scanners' extension
> error: Unable to find vcvarsall.bat

You don't have a C compiler installed.


> I need Cython in order to install "lxml" package !!

No, you don't. Just use a binary installer.

https://pypi.python.org/pypi/lxml/3.2.3

Even if you really wanted to install lxml from a source release, you
wouldn't need Cython for it.

Stefan

Chris Barker - NOAA Federal

unread,
Sep 5, 2013, 1:09:50 PM9/5/13
to cython-users
On Thu, Sep 5, 2013 at 9:40 AM, Stefan Behnel <stef...@behnel.de> wrote:
> error: Unable to find vcvarsall.bat

You don't have a C compiler installed.


indeed -- the free-as-in-beer MS Visual Studio Express version should work if you need it.

> I need Cython in order to install "lxml" package !!

No, you don't. Just use a binary installer.

https://pypi.python.org/pypi/lxml/3.2.3

Even if you really wanted to install lxml from a source release, you
wouldn't need Cython for it.

But if you do need Cython, you can get a binary from:


However, cython is pretty useless without a C compiler set up anyway...

-Chris






 
Stefan

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Pedro Pastor

unread,
Sep 5, 2013, 5:06:00 PM9/5/13
to cython...@googlegroups.com, stef...@behnel.de
Thanks Stefan and Chris,

I've gone the Cython way to install lxml because the "lxml-3.2.3.win-amd64-py2.7.exe"  at https://pypi.python.org/pypi/lxml/3.2.3 issues an installation error at the very beginnig of the process:

"Python version 2.7 required, which was not found in the registry"

and I cannot set the appropriate path.

It is very weird. I can run Python 2.7.3 from a Windows console and run several Python environments without any trouble. Python 2.7.3 (and libraries) are in the System Path.

On a different way, trying to install lxml from "pip" also ends up in a faulty process. I also get the error message:

"Unable to find vcvarsall.bat"

Could you please provide me any help?

Regards.
Pedro

Chris Barker - NOAA Federal

unread,
Sep 6, 2013, 12:31:18 AM9/6/13
to cython...@googlegroups.com
On Sep 5, 2013, at 9:15 PM, Pedro Pastor <pps...@gmail.com> wrote:

I've gone the Cython way to install lxml because the "lxml-3.2.3.win-amd64-py2.7.exe"  at https://pypi.python.org/pypi/lxml/3.2.3 issues an installation error at the very beginnig of the process:

"Python version 2.7 required, which was not found in the registry"

Not as helpful a message as it could be--you have python 2.7, but not the right one--you need to make sure the package you are installing matches the bit depth of the python you have: 32 or 64 bit.

I'm guessing you have a 32 bit python, but are installing a 64 bit lxml.

On a different way, trying to install lxml from "pip" also ends up in a faulty process. I also get the error message:

"Unable to find vcvarsall.bat"

Right, pip tries to install from source, you'd need a compiler properly installed.

HTH,

Chris

Could you please provide me any help?

Regards.
Pedro




On Thursday, September 5, 2013 6:40:41 PM UTC+2, Stefan Behnel wrote:
Pedro Pastor, 05.09.2013 18:34:
> I'm quite knew to Pythion ecosystem.
> I'm trying to install Cython in a Windows 7 Professional platform. I did
> use [ >> pip install cython ] from an IPython console and I got a faulty
> installation. I also got a long pip.log file. The final lines of the log
> say:
>
> ==============================================
> running build_ext
> building 'Cython.Plex.Scanners' extension
> error: Unable to find vcvarsall.bat

You don't have a C compiler installed.


> I need Cython in order to install "lxml" package !!

No, you don't. Just use a binary installer.

https://pypi.python.org/pypi/lxml/3.2.3

Even if you really wanted to install lxml from a source release, you
wouldn't need Cython for it.

Stefan

Pedro Pastor

unread,
Sep 6, 2013, 12:24:28 PM9/6/13
to cython...@googlegroups.com
Thank you very much Chris,

You've tackled the point and I've found the problem. My machine is x64 but my Python is x32.

My Python installation comes from a "Pythonxy" environment installation, and this only exists in x32 flavour. As long as my machine is x64, I did forget this tricky point of the Python installation. 

Thank you very much for your help, and sorry for the inconveniences.

Regards.
Pedro
Reply all
Reply to author
Forward
0 new messages