python - Google colab 中的 cython 模块中的编译错误
问题描述
我正在尝试在 google colab 中编译一个小的 Cython 文件 (*.pyx)。
cythonize
成功没有问题,产生一个 *.c 文件。后来,打电话时:
from distutils.core import setup
from Cython.Build import cythonize
cythonized = cythonize("module_path.pyx")
setup(name="my_module", ext_modules=cythonized)
我得到:
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
我发现有问题的论点是:
['-f', '/root/.local/share/jupyter/runtime/kernel-SOME_HASH-4fdbaebc4675.json']
这个命令在哪里定义?如何解决?
解决方案
推荐阅读
- amazon-s3 - 回形针图像未显示在 Action Mailer 电子邮件中
- azure - Azure blobstorage error when reading file
- django - 如何在 Django 中为用户注册表单实现自定义 HTML 模板?
- abap - Update DB table from internal table constructed inline with VALUE
- excel - 如何更改调用用户定义函数的不同单元格的值?
- python - 如何匹配格式为 1,234,567 的数字
- javascript - 如何 out.println Apache JKEnvVar SSL_CLIENT_DN 从 mod_ssl 到 java、javascript 或 html?
- matlab - 如何让我的 MatLab (.m) 文件的所有行运行?
- permissions - TYPO3:用户权限:允许隐藏插件内容元素
- python-3.x - 连接拒绝到 docker 上的 Postgresql