我的cython
/ pyximport
代码在读写文件系统上运行得非常好。
但是(为了测试目的),我需要在一个只读文件系统上尝试它。
如何更改cython / pyximport临时目录?(它在哪里执行任务?即动态编译?)
如何将此“工作目录”设置为当前目录以外的其他位置,例如/tmp/
(不是ro
,而是rw
)?
跟踪:
!! File "/usr/lib/python2.7/site-packages/Cython/Distutils/build_ext.py", line 301, in cython_sources
self.mkpath(os.path.dirname(target))
!! File "/usr/lib/python2.7/distutils/cmd.py", line 352, in mkpath
dir_util.mkpath(name, mode, dry_run=self.dry_run)
!! File "/usr/lib/python2.7/distutils/dir_util.py", line 76, in mkpath
"could not create '%s': %s" % (head, exc.args[-1]))
!! ImportError: Building module samplerbox_audio failed: ["DistutilsFileError: could not create '/root/.pyxbld': Read-only file system\n"]