zju3dv / pvnet-rendering

render images for pvnet training
Apache License 2.0
183 stars 46 forks source link

problem while install LMDB: lmdb/cpython.c:42:20: fatal error: Python.h: no such file or directory #25

Closed rlvc closed 4 years ago

rlvc commented 4 years ago

i download blender-2.79a-linux-glibc219-x86_64.tar.bz2 and try to use its budule python to run pvnet-rendering. step by step i have these python library installed: Package Version


    easydict      1.9     
    numpy         1.17.3  
    opencv-python 4.1.1.26
    pip           19.3.1  
    setuptools    41.6.0  
    torch         1.1.0   
    wheel         0.33.6 

then i run the command bellow under the pvnet-rendering directory: ../../3_soft/blender-2.79a/2.79/python/bin/python3.5m run.py --type rendering got error: ImportError: No module named 'lmdb' so i try to install lmdb with blender bundle python but meet these problem: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict- prototypes -fPIC -Ilib/py-lmdb -Ilib -I/home/rlvc-one/workspace/3_soft/blender- 2.79a/2.79/python/include/python3.5m -c lmdb/cpython.c -o build/temp.linux-x86_64-3.5/lmdb/cpython.o -UNDEBUG -w lmdb/cpython.c:42:20: fatal error: Python.h: no such file or directory i tried in pycharm to install lmdb and told me to "Make sure that you have installed Python development packages for your operating system.", but i already install python-dev

i found some solutions on google, like download correspoding python source release and copy the include directory to blender bundle python include, but met these problem:

gcc -pthread -shared -L/opt/lib/bz2/lib -L/opt/lib/lzma/lib -L/opt/lib/ssl/lib -L/opt/lib/zlib/lib -L/opt/lib/libc6/lib -L/opt/lib/ncurses/lib -L/opt/lib/gpm/lib -L/opt/lib/sqlite/lib -L/opt/lib/readline/lib -Wl,--version-script=python.map build/temp.linux-x86_64-3.5/lmdb/cpython.o build/temp.linux-x86_64-3.5/lib/mdb.o build/temp.linux-x86_64-3.5/lib/midl.o -o build/lib.linux-x86_64-3.5/lmdb/cpython.cpython-35m-x86_64-linux-gnu.so /usr/bin/ld:无法打开链接脚本文件 python.map:no such file or directory

sorry, i am new to python..

monajalal commented 9 months ago

@rlvc could you please guide how you fixed this issue?