Opened 5 years ago

Closed 5 years ago

#8978 defect closed duplicate (duplicate)

Trial won't run; cwd not part of sys.path

Reported by: Job Evers‐Meltzer Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: Branch:


I used to be able to run:

trial tests

from the root directory of our repo (

But after a recent update, I started getting:

 File "[...]/venv/local/lib/python2.7/site-packages/twisted/trial/", line 119, in _importFromFile
    module = imp.load_source(moduleName, fn, fd)
  File "tests/", line 4, in <module>
    from lbrynet.core import log_support
exceptions.ImportError: No module named lbrynet.core

Doing a git bisect, this is the commit that broke things:

It appears that before this commit, the cwd is part of sys.path, but after the commit its not.

In the old script, there was this line:

sys.path.insert(0, os.path.abspath(os.getcwd()))

Change History (3)

comment:1 Changed 5 years ago by Jean-Paul Calderone

See <>, this is probably a duplicate.

comment:2 Changed 5 years ago by Craig Rodrigues

Component: coretrial
Keywords: review added; trial removed

comment:3 Changed 5 years ago by Jean-Paul Calderone

Keywords: review removed
Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.