Compile error in a cython module in a Google colab

Viewed 207

I'm trying to compile a small Cython file (*.pyx) in a google colab. cythonize succeeds without problems, producing a *.c file. Later, when calling:

from distutils.core import setup
from Cython.Build import cythonize

cythonized = cythonize("module_path.pyx")
setup(name="my_module", ext_modules=cythonized)

I get:

DistutilsArgError                         Traceback (most recent call last)
/usr/lib/python3.7/distutils/core.py in setup(**attrs)
    133     try:
--> 134         ok = dist.parse_command_line()
    135     except DistutilsArgError as msg:

/usr/lib/python3.7/distutils/dist.py in parse_command_line(self)
    475         parser.set_aliases({'licence': 'license'})
--> 476         args = parser.getopt(args=self.script_args, object=self)
    477         option_order = parser.get_option_order()

/usr/lib/python3.7/distutils/fancy_getopt.py in getopt(self, args, object)
    234         except getopt.error as msg:
--> 235             raise DistutilsArgError(msg)
    236 

DistutilsArgError: option -f not recognized

An exception has occurred, use %tb to see the full traceback.

SystemExit: usage: ipykernel_launcher.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: ipykernel_launcher.py --help [cmd1 cmd2 ...]
   or: ipykernel_launcher.py --help-commands
   or: ipykernel_launcher.py cmd --help

error: option -f not recognized

I found that the offending arguments are:

['-f', '/root/.local/share/jupyter/runtime/kernel-SOME_HASH-4fdbaebc4675.json']

Where is this command defined? How to fix it?

0 Answers
Related