lsp-python-ms icon indicating copy to clipboard operation
lsp-python-ms copied to clipboard

python current working directory

Open artpelling opened this issue 3 years ago • 0 comments

I have an issue similar to #120 and #96, where imports of project modules fail when I send a file to the python interpreter with C-c C-c that is located in a subfolder of my project.

I tried all suggested solutions, but to no avail. The variables lsp-workspace-root and projectile-project-root are set correctly, but py-current-working-directory is always the directory of the file and the top-level project path is not part of sys.path().

The lsp-mode functionalities such as code completion and tooltips all work fine for said modules, so I am pretty sure it has something to do with how arguments are passed to python-mode. I can get everything to work as wanted, if I start the python process with run-python from the top-level directory first and then send the file to the interpreter, but this is inconvenient.

Maybe I am missing something or it is a problem with python-mode. I would be very happy, if someone could point me in the right direction!

artpelling avatar Jan 23 '21 14:01 artpelling