Questions tagged [python]

use for Python programming language in Emacs. Emacs supports several versions of the language implementation, versions, and coding styles. Python questions should augment with additional tags as appropriate as described in the description below.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

How to install mspyls without internet?

I would like to install mspyls language server on my work machine that does not have access to an internet. I am able to transfer files over to the work machine via thumb drive. Is there a way for me ...
0
votes
0answers
6 views

How do I change the Python interpreter in Aquamacs 3.5 (based on GNU Emacs 25.3.50.1)?

I have been unable to get my Aquamacs 3.5 (built on Gnu Emacs 25.3.50.1) to run Python 3. I have put the following lines in both my Preferences.el (the Mac equivalent of .emacs) and within an ...
0
votes
1answer
26 views

Showing full (unabbreviated) Python output in Org Mode

The result of a certain Python (statsmodel module) code in org-mode is abbreviated: #+BEGIN_SRC python import pandas as pd import statsmodels.api as sm auto_df=pd.read_csv('Auto.csv', usecols= [...
0
votes
0answers
15 views

Why is Selenium / Chromedriver giving me errors in Emacs' Python shell?

If I launch a Python shell inside Emacs with run-python and try to open a Chromium window with Selenium, I am suddenly running in to the following error: Python 3.8.5 (default, Jan 27 2021, 15:41:15) ...
0
votes
0answers
18 views

Report wrong Elpy-Behaviour, but to whom and how?

I'm using emacs to write my python-code and lately I found some wrong behaviour of one of the auto-format-features: Given this wrong code: def doStuff(self, s_database): return ("ASDF" @...
0
votes
0answers
13 views

How to fontify keyword arguments in `python-mode`?

I'm coding in python and it seems like the python-mode doesn't color the keyword-arguments. Note that I'm not talking about general keywords but keyword-arguments. As an example, in the next picture, ...
2
votes
1answer
25 views

Annoying “error in process filter: Overlapping strings detected”

When editing python code with elpy, if I type a single or double quote while writing a new line of code (i.e. adding or changing a line in existing code), the UI freezes momentarily, make the bell ...
3
votes
2answers
64 views

Is it possible to suppress `Fill column set to 80 (was 80)` message in the echo area?

When I open a Python file I keep seeing Fill column set to 80 (was 80) message in the echo area. I know I have set it this limit , but I don't want to be keep reminded about it. Is it possible to ...
1
vote
0answers
69 views

`lsp` does not start on python-mode-hook

I am using lsp under Python.lsp does not start when a Python file is opened, I have to do M-x lsp for each file I open. Also when I switch from find-file to another file I have to do M-x lsp all over ...
0
votes
0answers
10 views

Ipython as run-python binary, no tab complete

I've been using the standard python repl in emacs for a while and decided to change to use ipython with all of it's autocompletions and other features. Unfortunately, if I try using ipython in multi-...
0
votes
1answer
26 views

Toggling off all settings in python and julia to get bare setup

since recently I am using LSP for python, tex and julia on macos with spacemacs develop. To some extend this is great, but it is something awefully slow using a gui... and it seems that it is not only ...
1
vote
1answer
17 views

How do I get org-mode to treat the output of a non-latex code block as latex?

(Emacs: v27.1, Org: v9.5, pdfTeX: v3.14159265-2.6-1.40.21) I am using the following Python code block to print LaTeX code: #+BEGIN_SRC python :session :exports both :results output :wrap math ... #+...
0
votes
1answer
67 views

How can I jump back after `rope-goto-definition`?

I am using rope-goto-definition to jump into a module's definition, link. But I cannot jump back to where I was. xref-pop-marker-stack says Marker stack is empty. Is it possible to jump back after ...
0
votes
1answer
38 views

How to open org-mode table as a pandas dataframe (with column names)?

I can't find how to open an org-mode table as a pandas dataframe. Here is my example: #+NAME:tbl | a | b | |---|---| | 1 | 2 | #+BEGIN_SRC python :var tbl=electro :results replace output :session ...
0
votes
1answer
26 views

Repeating characters in `python-mode.el` shell interaction

I experience strange behaviour when using python-mode. When sending characters to the shell using C-c C-e, the first string works well. After that, the characters start repeating, in a manner that is ...
0
votes
0answers
25 views

Can't reproduce my (spacemacs) config

Two PCs, same version of manjaro on both, same emacs version, same spacemacs version/branch, same config file. Problems with python mode and company: On my second PC, autocomplete doesn't work ...
0
votes
1answer
28 views

How to restart elpy if it is not launch?

I am working with python using Emacs 26.3. My goal is to jump to definition of the function and jump back, for that I am using https://github.com/jacktasia/dumb-jump, which runs elpy-goto-definition ...
0
votes
1answer
36 views

How to color specific keywords in python-mode?

My goal is to color specific keywords as function definition such as log in Python-mode to a spefic color or color of functions. Example, pattern for log("...."): coloring only log. from ...
5
votes
0answers
93 views

xref unsuccessful in python buffers: “no definition found”

The command xref-find-definitions is no longer working for me in Python buffers (with elpy-mode enabled. Its companions, such as xref-find-references, are also not working in Python buffers. ...
0
votes
1answer
29 views

How do I open an inferior Python process in a full window from the command line?

From the command line, I want to open an inferior Python process in a full window. I have tried: emacs --eval '(run-python)', but when Emacs opens, the *scratch* buffer is shown instead of the ...
0
votes
1answer
41 views

How to apply flycheck right after a new file is opened

I am using flycheck for for Python. I want flycheck to detect any errors right away when any Python file is opened. Currently it can detect if there is a modification and save operation is performed. ...
0
votes
0answers
34 views

How to remove <header-line>

I'm pretty much emacs noob. I've been tinkering in spacemacs for around a month now and got it set up pretty much how i like it. But since i updated it, header line that appears when i open a project ...
0
votes
0answers
83 views

mypy FileNotFoundError: [Errno 2] No such file or directory: '.mypy_cache/3.8/utils.data.json'

I keep having following warning message, even I have the recent version of python-mypy not sure why this warning message is generated; is there any way to fix this: Try installing a more recent ...
2
votes
0answers
40 views

See mypy type of what's under point

Is it possible to see mypy types in emacs? I would like a command that does something like show the type of what's under point (presumably getting that information from the mypy cache for speed?). ...
0
votes
1answer
25 views

How do I specify the window height of the Python interpreter?

Suppose I am editing a file in python-mode. If I start the Python interpreter using M-x run-python (or C-c C-p), the Python interpreter opens in a window (*Python*) in the bottom half of the frame. ...
0
votes
0answers
37 views

importmagic.el isn't respecting configuration style

I am following the instructions here for how to customize importmagic. I have the following in my init.el: (setq importmagic-configuration-style-alist '((multiline . backslash) ...
0
votes
0answers
59 views

importmagic for python

I have the following in my .emacs.d/init.el, along the lines of what is suggested here: (require 'importmagic) (add-hook 'python-mode-hook 'importmagic-mode) (define-key importmagic-mode-map (kbd &...
0
votes
1answer
52 views

Cannot evaluate matplotlib in Python code block

These are my first attempts to plot graph in Python. Following this example , I tried a very simple graph import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np x = np.linspace(0,...
1
vote
0answers
100 views

Jupyter notebook, matplotlib visualization not showing up

I am a new Emacs user and proceeded to the install following the tutorial at: https://realpython.com/emacs-the-best-python-editor/#integration-with-jupyter-and-ipython. Now I am running a Jupyter ...
0
votes
0answers
34 views

emacs opens py file as sh file

Emacs has opened a py file as a shell script. What went wrong and how to change?
0
votes
1answer
39 views

From one-line list to one element per line in python-mode

How do I turn a long one-line list, such as test_list = ['a0000000', 'b1111111', 'c2222222', 'd3333333', 'e4444444', 'f5555555', 'g6666666'] into a one element per line list: test_list = ['a0000000', ...
0
votes
2answers
65 views

Is there a way to show python generated plots in the python interpreter console?

I use emacs for most python programming, but really miss the inline plot feature combined with printed output in Spyder. See picture. I've been experimenting with various interpreter settings but ...
1
vote
2answers
185 views

Symbol's function definition is void: rx-let

Whenever I try to use elpy, or even just fontlock (with elpy disabled) in a python file, I get the error that rx-let is void. This is what I got from --debug-init: Debugger entered--Lisp error: (void-...
0
votes
0answers
25 views

Python indent region is wrong

Given the code: def main(args=None): if args is None: args = sys.argv[1:] load_data() Calling indent-region on the code (under python mode), the output would be: def main(args=None): ...
1
vote
0answers
35 views

Use conda environment in ansi-term

I would like to be able to use conda activate to switch between environments in ansi-term. I am running bash in ansi-term from Emacs 27.1 on MacOS Catalina. Currently, executing conda activate <...
0
votes
2answers
103 views

elpy flymake does not recognize local .pylintrc

I have the following in the project root for my .pylintrc: [FORMAT] # Maximum number of characters on a single line. max-line-length=1000 # String used as indentation unit. This is usually " ...
0
votes
1answer
118 views

How to turn off python-mypy in spacemacs flycheck-mode?

I'm using the latest Spacemacs with the Python layer. I'd like to turn off python-mypy in flycheck-mode, but the following in my ~/.spacemacs doesn't work: (defun dotspacemacs/user-config () (add-to-...
0
votes
0answers
15 views

Emacs python-mode language formatting does not reapply on buffer on newly typed text

When I open a .py file for the first time the formatting is perfect, colors match special words as expected in Python But when I type new text in the buffer, it inherits the color of the same ...
0
votes
1answer
51 views

How to run Python code and obtain its result in the minibuffer

I am using the following answer for How do you run Python code using Emacs. I was wondering instead of opening python shell using C-c C-z and running C-c C-c to get results; => Can only the output ...
3
votes
1answer
62 views

Can we do `C-c >` and `>` and `>` to continue indentation

I am using following answer to handle indentations Emacs bulk indent for Python C-c > or C-c C-l shifts the region 4 spaces to the right C-c < or C-c C-r shifts the region 4 spaces to the left ...
0
votes
1answer
30 views

How to modify a file you're debugging with realgud

I understand mechanically from here: debugging: how to optimize a RealGUD workflow How to edit code in the source window using realgud? I can use C-x C-q to disable read-only mode on the python file ...
1
vote
2answers
53 views

Why is the matplotlib plot produced by executing `org-babel-execute-src-block` contain errors?

The context Consider the following Emacs configuration $ cat ~/.emacs.d/init.el (org-babel-do-load-languages 'org-babel-load-languages '((python . t))) $ and the ...
0
votes
3answers
128 views

elpy (and evil-mode) do not react on TAB

This is my elpy-config 1Elpy Configuration 2 ...
1
vote
1answer
77 views

Confused regarding .dir-locals.el and projectile

I have a python project, it has tests and I can execute them from the command line. I just read about .dir-locals.el in the projectile documentation and I want to execute tests from inside emacs using ...
0
votes
0answers
19 views

Searching for functions

i have the problem, that lsp cant find my functions in python, because they are in a module, which is passed as parameter. What is a another good way to find the use of a specific function?
2
votes
1answer
121 views

Call Python from YaSnippet and insert result

I'm trying to build a comparable functionality as described here: https://castel.dev/post/lecture-notes-1/#sympy-and-mathematica Basically, he's using something comparable to yasnippet to send a ...
1
vote
2answers
218 views

how can I run conda in emacs shell?

I've been using Python command 'conda' in the terminal on my Mac. But when I run a command like 'conda activate ...' in Emacs's shell (M-x shell), it gives me this objection: CommandNotFoundError: ...
1
vote
2answers
123 views

Why is my Imenu not showing function and class definitions?

I feel like something is wrong with my Imenu setup, because here is what it shows on a simple Python script: It seems to show some variable definitions, but doesn't have separate entries for the ...
1
vote
0answers
21 views

How to replace sections of non-org files from within org-mode?

I am trying to write some notes on django with the help of org babel. Is there a way to replace a block in a file(which was not tangled with org) after I eval a certain src block? Here's what I mean: ...
0
votes
0answers
34 views

Automatically set `fill-column' based on flake8 setup

How can I automatically set fill-column based on flake8 configuration for python-mode buffers, specifically the max-line-length value in .flake8? Solutions that employs existing extensions are welcome....

1
2 3 4 5
10