xunlei-lixian icon indicating copy to clipboard operation
xunlei-lixian copied to clipboard

ImportError: No module named lixian_commands.util

Open meokey opened this issue 10 years ago • 2 comments

$ lx Traceback (most recent call last): File "/bin/lx", line 3, in from lixian_commands.util import * ImportError: No module named lixian_commands.util

to fix this issue, I have to modify lixian_cli.py a little bit:

!/usr/bin/env python

import sys

define base path, where the path has to be adapted to the real directory

sys.path.append('/usr/share/xunlei-lixian') from lixian_commands.util import * import lixian_help

meokey avatar Nov 14 '14 20:11 meokey

Against this change.... and this is a non-issue.

This is not the correct way to do it. It should not be assumed that xunlei-lixian will be installed to /usr/share for everyone, but rather it's a local administrator's choice (should xunlei-lixian be installed site-wide)

If you intend to this , you should append "/usr/share/xunlei-lixian" to PYTHONPATH in your shell environment.

moving lx executable to /bin is just plain wrong, you should symlink it instead.

xiamx avatar Nov 15 '14 16:11 xiamx

I agree that it should be site-wide where xunlei-lixian would be installed.

The issue is that, I'm not familiar with Python, and when I follow the README instruction provided, I encountered the error message. It took me a while to figure out it was a "path" issue and I was not aware of PYTHONPATH until you mentioned it.

At least, it should be a "setup" step to append the xunlei-lixian path to the environment variable PYTHONPATH before linking xunlei-lixian_cli.py to /bin/lx and attempting to execute it, or, provide a clear HowTo instruction for Python novice users.

meokey avatar Nov 17 '14 14:11 meokey