On 15 November 2017 at 00:02, Jacob Keller <
jacob....@gmail.com> wrote:
> I installed a copy of stgit using a local user with "make install" ,and when
> running it produces the following output:
>
> Traceback (most recent call last):
> File "/home/jekeller/bin/stg", line 24, in <module>
> from stgit.main import main
> ImportError: No module named stgit.main
>
> This is because it installed the module into $HOME/lib/python2.7
>
> How do I make python aware of this location?
In theory, ~/bin/stg should set sys.path based on the installation prefix.
I wonder whether sys.prefix is already '/home/jekeller' in your case
and the sys.path update no longer happens. I don't mind changing the
install flags to --user but for a /usr sys.prefix python installation,
we'd still need the sys.path updated in ~/bin/stg. Maybe
site.getusersitepackages() can help here or someone has a better idea.
As a quick fix you can remove the ~/bin/stg check on prefix !=
sys.prefix so that sys.path is always set.
Catalin