PYTHONPATH extension? I am trying to write some scripts to test blender.  I have developed some helper tasks that I would like to use from a common module.  However when I move the task from the working script into a different file and try and get the script to import from the second file it does not work.

Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
  File "E:\blender-addons\test\test_import_obj.py", line 14, in &lt;module&gt;
    import test_helper
ModuleNotFoundError: No module named 'test_helper'


So I figured that I needed to at least set the PYTHONPATH to the current directory.  However when I do that then the blender bit stops working

Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
  File "E:\blender-addons\test\test_import_obj.py", line 214, in &lt;module&gt;
    main(infile, module)
  File "E:\blender-addons\test\test_helper.py", line 22, in copy_plugin
    bpy.ops.wm.addon_install(overwrite=True, filepath=zfile)
NameError: name 'bpy' is not defined


I am using windows to develop my scripts.

What am I missing?
Don't set PYTHONPATH, but rather add your script's path to sys.path. You can do that manually in Blender's Python Console, in a script you embed in a blend file via Blender's Text Editor, or in a small add-on that you place in a path that's already searched for by Blender.

Non-scripting approaches would be to set an alternative scripts folder in the user preferences, or to use symlinks to make Blender find your code.