Comments (7)
@ryanprior Thanks for your help. I have configured my dotfile according your code as follows:
dotspacemacs-configuration-layers
'((python :variables
python-backend 'lsp
python-lsp-server 'pyright
python-shell-interpreter "ipython"
importmagic-python-interpreter "python3"
)
and I configured this in my user-config()
:
;; python ide 配置
(use-package pytest :init
(spacemacs/set-leader-keys-for-major-mode 'python-mode "td" #'python-pytest-dispatch))
(setq python-shell-completion-native-enable nil)
However, when I typed SPC
m
'
in a Python script, the following warning popped up in the left window:
Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support readline, yet ‘python-shell-completion-native-enable’ was t and "ipython" is not part of the ‘python-shell-completion-native-disabled-interpreters’ list. Native completions have been disabled locally. Consider installing the python package "readline".
I had searched this warnning and added this code in my user-config()
:
(setq python-shell-completion-native-enable nil)
I don't know if this is the best practice, but warning has indeed disappeared. But when I used SPC
m
'
and tried to interact with the ipython on the right side, things became very strange.
Firstly, I don't know what is in the lower half of the window in the picture, as it occasionally pops up when I write the script. Secondly, the iPython interaction environment on the right is very abnormal, as it seems to copy the last character and repeat my input before giving output, and the preceding sequence number is skipped And cannot share the code content on the left side.
I have no idea about this. can you give me more advice? :)
here is my dotfile.
from spacemacs.
Hi @LittFlower, great to have you here! I suggest creating a discussion in this repo (link: https://github.com/syl20bnr/spacemacs/discussions) as the Issues are only meant to be used for problems and development, while the Discussions are for open ended questions.
(Here's my answer, and I'll move it into a response in Discussions if you follow my advice above 😄)
My Python configuration is quite short, since the Python layer already has a really useful default configuration. I have this in my Spacemacs dotfile:
dotspacemacs-configuration-layers
'((python :variables
python-backend 'lsp
python-lsp-server 'pyright
python-shell-interpreter "ipython"
importmagic-python-interpreter "python3")
)
# then later...
(use-package python-pytest :init
(spacemacs/set-leader-keys-for-major-mode 'python-mode "td" #'python-pytest-dispatch))
I also use direnv with direnv-mode to automatically activate my Python virtual environments.
I use M-x python-pytest-dispatch
(which you can see I bind to SPCtd) to run my Python tests during development, and I use M-x spacemacs/python-start-or-switch-repl
(bound to SPCm' by default) to create an interactive Python REPL for experimentation.
Hope this helps! Keep asking questions, and let us know if you have any ideas for contributions you'd like to make.
from spacemacs.
sincerely thank you. I will contribute to Spacemacs if i am able to.
from spacemacs.
@LittFlower oh my that doesn't look nice.
If you change python-shell-interpreter "ipython"
to python-shell-interpreter "python3"
does that work any better? I think that ipython support might not be in a good state anymore. I just tried it with "python3" in my Spacemacs and it's working fine with completions (which didn't use to be the case)
from spacemacs.
Wuuuu......Could you read Chinese? Or use a translation tool to view this page? I'm very happy with the configuration in this page. But it is in emacs not spacemacs... How can I use/convert the configuration in spacemacs as a spacemacs-er? @ryanprior
from spacemacs.
Hmm this sounds very strange.
The message in the lower part of your screen looks like a python script which is to be evaluated at run time not sure why this is shown in the UI though but it shows a python file I don't know.
My config is below:
(python :variables
python-backend 'lsp
python-lsp-server 'pylsp
python-test-runner 'pytest
python-formatter 'lsp
python-format-on-save t
python-save-before-test t
python-sort-imports-on-save t)
This works fine on my side, I am on manjaro, this should be near enough to arch for comparison.
Could it be that import-magic is causing this? I am not using it for it is really outdated now but I have seen you have configured the python interpreter.
Also it would be interesting if you running a stock emacs release or your own build. If you run your own build please retry with a stock build.
from spacemacs.
Closed due to inactivity
from spacemacs.
Related Issues (20)
- Unable to read help `C-h` minibuffer bottom text line HOT 1
- Saving files of any size is annoyingly slow HOT 10
- Erc layer: Wrong type arguement: commandp, spacemacs/erc-find-channel-log
- Error when starting spacemacs HOT 11
- `#include <fstream>` deleted by `c-c+-organize-includes` HOT 1
- Unable to Plot Graphs in R HOT 2
- [c-c++] There is no command under 'compile' leader key. HOT 3
- Spacemacs Loads .Rprofile when LSP is ON HOT 1
- display-buffer-alist not respecting window settings HOT 2
- Terminal nvim colorscheme affected by installing spacemacs HOT 1
- How can i move .spacemacs to .emacs.d or ~ , when i use it in the win10? HOT 2
- Deleting a file drops you into an InactiveMinibuffer with no spacemacs keybinds HOT 3
- Incorrect macro-expansion of evilified-state-evilify-maps with pre-bindings
- SPC o- which-key: There are no keys to show HOT 2
- Slow performance of Emacs, in general, and with LaTeX in particular HOT 5
- xclipboard layer does not work HOT 3
- How can I make org-roam's buffer look useful and nice like it does in doom emacs? HOT 4
- How can I pin a specific package version or commit, e.g. for org-mode? HOT 4
- Modeline RHS missing when viewing info help HOT 2
- helm-descbinds disable which-key HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spacemacs.