Pythonpath not updating sys path
= "__main__": path = __file__ elif and sys.argv and not sys.argv == "-c": path = sys.argv path = realpath(expandvars(path)) while exists(path): if exists(join(path, markerfile)): break else: path = dirname(path) errormsg = " ".join(("Could not find", markerfile)) assert exists(path) and path !
= dirname(path), errormsg path = join(path, "src") (_, subdir_list, _) = os.walk(path).next() for subdir in subdir_list: if subdir.startswith("."): continue subdir_path = join(path, subdir) if subdir_path in sys.path: continue append(subdir_path) _setpath() Currently, I need to keep a separate but identical copy of this function in each entry point.
For the most part this is usually, and thankfully, due to Blender or a script simply trying to access Python via a "System Variable" that doesn't exist - the path to Python itself.In most cases it happens after an automatic refactoring with Py Charm (typically if you use the logging framework in the classical way)*, if it happens for other reasons it’s a signal that your software design is not sound and that you must review it carefully.So, you've written your first Django app, and deployed...I added a new class and it will not see it since it looks like gh Python component somehow stored the first iteration of the module. Thank you, However, if you are seeing old behavior, it is likely that you have two copies of the same script, and the old one is loaded before the new one is found.Make sure that the module you want to use is loaded from the right location.