(2019.12.17 resolved) Cython compile ImportError: No module named Cython.Build

  • HelloWorld program

    As the first program to learn, " Cython Use Case: Output Hello World ", there may be errors like the title.

    insert image description here

    In the actual file there isCython.BuildYes, this is because of environment configuration issues.

    insert image description here

  • How to call Python3 in cmd

    PyCharmmiddle yesPython3, already installedCython, but inCMDcall directly inpythonis usingPython2.7, and is not installedCython, hence the error.

    in this machinepythoncorrespond2.7,pycorrespond3.7.

    py setup . py build_ext   - - inplace
     # replace 
    python setup . py build_ext   - - inplace
    
    • 1
    • 2
    • 3

    Still can't solve the problem, because the call herePython 3.7not yetPyCharmmiddlePython,PyCharmmiddlePythonYesAnacondain, therefore, inPython3.7install again inCythonsolve this problem.

    py - m pip install Cython # -m means to call the module 
    py setup . py build_ext   - - inplace
    
    • 1
    • 2

    insert image description here

  • References

  1. Switch freely between python2 and python3 on cmd

Related: (2019.12.17 resolved) Cython compile ImportError: No module named Cython.Build