问题遇到的现象和发生背景
处理数据集时
问题相关代码,请勿粘贴截图
root@202120085400040-0:/workspace/555/mesh-fusion-master# python 2_fusion.py --mode=render --in_dir=examples/1_scaled/ --depth_dir=examples/2_depth/ --out_dir=examples/2_watertight/
Traceback (most recent call last):
File "2_fusion.py", line 10, in
import librender
File "/workspace/555/mesh-fusion-master/librender/init.py", line 5, in
ctypes.cdll.LoadLibrary(os.path.join(pyrender_dir, 'pyrender.so'))
File "/usr/lib/python3.6/ctypes/init.py", line 426, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python3.6/ctypes/init.py", line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: /workspace/555/mesh-fusion-master/librender/pyrender.so: cannot open shared object file: No such file or directory
我的解答思路和尝试过的方法
在gtihub上有答主回答了这个问题,但是我无法理解那个操作
Ok found the solution:
in librender directory the command python setup.py ... created a file pyrender.cpython-36m-x86_64-linux-gnu.so.
I copied this file into root directory mesh-fusion and renamed it into pyrender.so
In librender.init.py i changed line 5 into
ctypes.cdll.LoadLibrary(os.path.join(pyrender_dir, '../pyrender.so'))
Similarly, in libfusioncpu the file cyfusion.cpython-36m-x86_64-linux-gnu.so was generated. I copied it into root directory mesh-fusion and renamed it into cyfusion.so
Then code works.
我想要咨询
用python setup.py 生成一个.so文件是如何操作的呢?就是这一句
in librender directory the command python setup.py ... created a file pyrender.cpython-36m-x86_64-linux-gnu.so.