danpovey / lilcom

Small compression utility
Other
33 stars 10 forks source link

Import issues after upgrading to version 1.6 #56

Open srdecny opened 1 year ago

srdecny commented 1 year ago

Hello,

after upgrading to 1.6 we started to observe really weird import issues (when executing tests via pytest), like this:

try:
  from _k2 import DeterminizeWeightPushingType
 E       ImportError: libpython3.10.so.1.0: cannot open shared object file: No such file or directory

The file in question does exist, but for some reason it is simply not found.

torch==1.13.0 k2==1.22.dev20221121+cuda11.6.torch1.13.0

After pinning lilcom to version 1.5.1, these import errors went away. Unfortunately, I can't really offer a reproduction: manually importing pytorch and _k2 from python shell results in the ImportError above with both versions of lilcom. However, the tests that execute the import do not throw this error if licom is pinned to 1.5.1. The tests are executed in a ubuntu:20.04 container with python 3.10.

I apologize that the description is so vague and for not bringing a reproducible case. I hope you might be able to identify what's going on but if not, I am happy to provide further info.

csukuangfj commented 1 year ago

Are you able to modify the environment variable

LD_LIBRARY_PATH

to fix it.

srdecny commented 1 year ago

Unfortunately not, if I set the LD_LIBRARY_PATH to point to the right directory, it seems like it breaks a lot of other things.

csukuangfj commented 1 year ago

Could you describe how did you install Python and where can you find libpython3.10.so.1.0?

csukuangfj commented 1 year ago

Also, did you install k2 and lilcom from source?

danpovey commented 1 year ago

lilcom does not depend on k2 at all, so I don't see why it would make a difference to this k2-based import error.