今天在配置py-faster-rcnn时遇到错误:
ubun2@ubun2:~/py-faster-rcnn$ ./tools/demo.py
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 563, in
main()
File "/usr/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 237, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 578, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 524, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 408, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in
from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
查找了各种资料,发现是ubuntu的一个bug,具体解决方法为:创建一个软链接:
sudo ln -s /usr/lib/python2.7/plat-*/_sysconfigdata_nd.py /usr/lib/python2.7/
然后该问题就解决了。
参考:https://blog.csdn.net/qq_15773669/article/details/52126521