I have been wondering why emacs-jedi would sometimes find stuff in the wrong directory for quite some time now, and I just realized that it's because although it would honor a correctly-set VIRTUAL_ENV variable when starting the server, it would not consider that part of the hash key. Therefore, since I have a different VIRTUAL_ENV automatically computed for every project directory, if I have two projects open at once in Emacs, whichever one opened first control's jedi's view of sys.path.
I worked around this by adding (set (make-local-variable 'jedi:server-args) (list "--virtual-env" env-to-use)) into my python mode hook, which appropriately mangles the hash key, but this should really be automatic.
I have been wondering why emacs-jedi would sometimes find stuff in the wrong directory for quite some time now, and I just realized that it's because although it would honor a correctly-set
VIRTUAL_ENVvariable when starting the server, it would not consider that part of the hash key. Therefore, since I have a differentVIRTUAL_ENVautomatically computed for every project directory, if I have two projects open at once in Emacs, whichever one opened first control's jedi's view ofsys.path.I worked around this by adding
(set (make-local-variable 'jedi:server-args) (list "--virtual-env" env-to-use))into my python mode hook, which appropriately mangles the hash key, but this should really be automatic.