Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

ImportError: No module named lixian_commands.util #436

Open
meokey opened this issue Nov 14, 2014 · 2 comments
Open

ImportError: No module named lixian_commands.util #436

meokey opened this issue Nov 14, 2014 · 2 comments

Comments

@meokey
Copy link

meokey commented Nov 14, 2014

$ 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

@xiamx
Copy link

xiamx commented Nov 15, 2014

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.

@meokey
Copy link
Author

meokey commented Nov 17, 2014

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants