Python interpreter not detected via C-c C-p and doesn't print anything #505
Unanswered
parvizfarnia asked this question in Q&A
Replies: 1 comment 1 reply
-
I managed to solve the first problem. I added the following to my Emacs init.el file : But the other problem persists, that is, doing |
BetaWas this translation helpful?Give feedback.
1 reply
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone and Merry Christmas
My environment:
Here is how I proceeded to install
python-lsp-server:start /B runemacs.exe)Then I came back to Emacs and I installed the following packages from MELPA:
And finally I put the following in my Emacs configuration file (org file) to enable
lsp-modeforPython:Generally, it seems that it is working. However, I have currently two issues:
As I said, first, I enabled my Python virtual environment and then, within the very same terminal, I launched Emacs in background. My requirement is that
lspshould consider as Python interpreter, the same interpreter of the currently running virtual environment (Python 3.12.0). However, due to some technical constraints, I have not added that interpreter in myPATHenvironment variable. Currently only Python 3.10 is in myPATH. Consequently when I runC-c C-pto start a Python process, it opens a Python 3.10 shell instead of 3.12. Therefore, I need a way to telllsp clientto take the very Python interpreter used bylsp-server, which is that of the current running virtual environment.After running
C-c C-pif I come back to my Python program buffer and doC-c C-cin order to send the current buffer to Python process for running, nothing happens and the result is not printed, there is no output. Consider the following example:If I do
C-c C-cwithin the buffer containing the above program, then the only thing that happens in*Python*buffer (Python process launched via C-c C-p) is a new prompt line>>>which is added and that's all. No "Hello World" message is printed as if the Standard Output was not available. I even introduced a syntax error in the program to see whether doingC-c C-cwill cause the*Python*process buffer print an error message, but again, the same problem only a new prompt line>>>is added. I wonder whether this*Python*process communicates at all with the buffer containing my Python program.Therefore, I would like to know what is wrong with my configuration and how to solve these issues.
Thanks in advance.
BetaWas this translation helpful?Give feedback.
All reactions