I'm trying to get the Cython Hello World tutorial to work and getting an Attribute Error on the compilation.
My Hello world program, in Python 3.4:
print("Hello World from Cython")
And the setupfile, setupCythonHelloWorld.py:
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize('helloWorld.pyx')
)
At the command line:
py -m setupCythonHelloWorld.py build_ext --inplace running build_ext
Command line returns and error:
Error while finding spec for 'setupCythonHelloWorld.py' (<class 'AttributeError'>: 'module' object has no attribute '__path__')
Here's some details on my computer and install:
I've uninstalled and reinstalled all of my windows compilers several times now, which is no fun. I know I need MS C++ 2010 because I have Python 3.4 and I need the compilers to match. There is a lot of information out there on MinGW, but also guidance not to use that compiler as it doesn't match what Python is built with for Windows.
Most most recent reinstall is listed under "Microsoft Visual C++ 10.0 standalone: Windows SDK 7.1 (x86, x64, ia64)". I've also tried a few other ways, including the python 3.4 section of "Compiling Python extensions on Windows."
Any help would be greatly appreciated. I've done a lot of installing and uninstalling of various Windows VS and SDK versions and I'm not much closer than I was 7 hours ago. Thanks.
This is related to a number of other topics:
Ok, I punted. I upgraded to Python 3.5 which makes things work much, much easier.
It was just as easy as explained in the Python 3.5 section of Compiling Python extensions on Windows:
I spent over 9 hours today struggling with MS 2010 compilers for Cython on Python 3.4... and never got it to work. I got C++ 2015 Build Tools and Cython using Python 3.5 to run Hello World in under an hour.
If anyone knows how to make it work I'm interested to know. However, unless something goes horribly wrong with my dependencies I don't think I'm going to look back at Python 3.4 ever again.