No module named Cython and Running cythonize failed [Fix]

Updated on May 15, 2020

I have been using Websockify to allow the browser to connect to any application or service on a Linux machine. This involves setting up Websockify server that translates the WebSockets to the normal socket and enables the traffic to follow between the client and the server. Installation of Websockify is simple, but the process ended with an error “No module named Cython. RuntimeError: Running cythonize failed!“. And remember that the Websockify binary is not available for PPC64LE architecture (like most of the packages), so I ended up compiling it from the source.


I’m using the command python3.6, because Websockify requires Python version 3 and above. If your default Python version is greater than 3, then you just need to use python command instead of python3.6.

The installation is started using the below command.

#python3.6 install
run_build = parse_setuppy_commands()
Cythonizing sources
Processing numpy/random/
Processing numpy/random/_mt19937.pyx
Traceback (most recent call last):
  File "/tmp/easy_install-n7o_lgt3/numpy-1.18.4/tools/", line 61, in process_pyx
    from Cython.Compiler.Version import version as cython_version
ModuleNotFoundError: No module named Cython
RuntimeError: Running cythonize failed!

How to fix No module named Cython

We need to install Cython package depending on the version of Python installed on the system as below:

#pip3.6 install Cython
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3.6 install --user` instead.
Collecting Cython
  Downloading (971kB)
    100% |████████████████████████████████| 972kB 961kB/s
Installing collected packages: Cython
Successfully installed Cython-0.29.17

That’s it. As the Cython package is installed,  I went on to install Websockify successfully.

Was this article helpful?

Related Articles

Leave a Comment