Forums

Problem importing user installed package

I have installed a package (dropbox API in my particular case) using "pip install --user dropbox". This installs the package in /home/myusername/.local/lib/python2.6/site-packages/ and this path is added tot the sys.path. So far so good. But this path is added after all system installed packages. This caused my program to import up some other unintended module (some 3rd party dropboxclient installed by default).

I think user installed packages should be selected before default packages. IOW /home/myusername/.local/lib/python2.6/site-packages/ should be inserted at the start of sys.path.

Am I looking at this the wrong way?

Marcel

That looks like a bug our side - you're right, user-installed packages should override system ones. I'll add fixing it to our to-do list with an upvote on your behalf; in the meantime I think the best workaround is for you to manually override sys.path in your scripts. Sorry for the inconvenience!

+1

upvoted.