Solved pyassimp.errors.AssimpError in conda

This error occurred because of error in finding .extension files.
 
os.path.splitext(filename)[-1].lower() not in ext_whitelist:  ### this line had bugs, failed to select files with extensions .so.x  [.so.1  .so.2  .so.3.1] but worked on simple extensions only. like- .so .dll

Added a mechanism to remove this bug.
pull/2035/head
Ravin Kumar 2018-06-22 12:22:27 +05:30 committed by GitHub
parent 185c84f93d
commit 7b0f100fc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 4 deletions

View File

@ -27,7 +27,7 @@ additional_dirs, ext_whitelist = [],[]
if os.name=='posix': if os.name=='posix':
additional_dirs.append('./') additional_dirs.append('./')
additional_dirs.append('/usr/lib/') additional_dirs.append('/usr/lib/')
additional_dirs.append('/usr/lib/x86_64-linux-gnu') additional_dirs.append('/usr/lib/x86_64-linux-gnu/')
additional_dirs.append('/usr/local/lib/') additional_dirs.append('/usr/local/lib/')
if 'LD_LIBRARY_PATH' in os.environ: if 'LD_LIBRARY_PATH' in os.environ:
@ -223,10 +223,25 @@ def search_library():
# our minimum requirement for candidates is that # our minimum requirement for candidates is that
# they should contain 'assimp' somewhere in # they should contain 'assimp' somewhere in
# their name # their name
if filename.lower().find('assimp')==-1 or\
os.path.splitext(filename)[-1].lower() not in ext_whitelist:
#if filename.lower().find('assimp')==-1 or\
# os.path.splitext(filename)[-1].lower() not in ext_whitelist: ### this line had bugs, failed to select files with extensions .so.x [.so.1 .so.2 .so.3.1]
# continue ### worked on simple extensions only. like- .so .dll
##### Modified Code --- to correctly select extension files #####
if filename.lower().find('assimp')==-1 :
continue continue
is_out=1
for et in ext_whitelist:
if et in filename.lower():
is_out=0
break
if is_out:
continue
##### Modified Code --- to correctly select extension files #####
library_path = os.path.join(curfolder, filename) library_path = os.path.join(curfolder, filename)
logger.debug('Try ' + library_path) logger.debug('Try ' + library_path)
try: try: