4

I have been using python 3.3

This is an old problem as I searched, and this is what I did:

helloworld.pyx

print("Hello world!")

Then, in ipython, I did:

import pyximport; pyximport.install()
import helloworld

It says:

ImportError: Building module helloworld failed: ["ValueError: ['path']\n"]

The same problem did not happen with python 2.7

I googled this: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows and realized that I have to install Windows SDK for Windows 7 and .NET Framework 4. As it comes with the VC++2010 Redistributables, I did not install the redistributables alone again. I thought I had everything ready, but the import error still remains.

Could anyone please help me solve it?

Thank you!

-Shawn

1
  • 1
    Do you really need pyximport? It seems the error messages might be more intuitive if you build an extension module as a separate step, and then import it normally. Commented Jan 21, 2014 at 3:14

2 Answers 2

1

install Windows 7 SDK, then open cmd run: "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64

then run: python setup.py install

Sign up to request clarification or add additional context in comments.

Comments

1

I was having the same issue and the same environment (win7 64bit, python-3.3.3 64bit).

I have

  1. installed the Windows 7 SDK as described on the wiki cython wiki as you did,
  2. applied the patch (msvccompiler9_33.diff) from this python bug,
  3. fixed the above patch by defining a missing variable as described here
  4. Installed MS Visual C++ Express 2010 (seems to be required)
  5. Updated the Windows 7 SDK to include the "Windows Headers and Libraries", "Tools" and of course the "Visual C++ Compilers" the MSVC++2010 redistributable.

And now I can compile and import the helloworld.py just fine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.