- Don’t forget to uncomment
python
ininit.el
- Change enable
lsp
under:tools
and changepython
to(python +lsp)
if you’re planning to use a Language Protocol Server using lsp-mode. - Enable
(company +childframe)
under:complection
as well.
- Change enable
- Run
doom doctor
and look inside the python section to see what executables you lack and install them.
- First see the LSP section of the main file
M-x run-python
to open a python shell.python-shell-send-region
orC-c C-r
to send a selected region to the shell.python-shell-send-file
orC-c C-l
to send another file to the shell.python-shell-send-buffer
orC-c C-c
to send a selected region to the shell.
- Once a virtual environment is activated,
vterm
will open a terminal with that certain environment activated.
Virtualenv or Venv
pyvenv-workon
to activate a virtualenv defined in~/.virtualenvs
.- Install virtualenv using
pip install --user --upgrade virtualenv
- After opening a python file,
pyvenv-create
to create a venv.
- Install virtualenv using
pyvenv-activate
to activate a venv from a certain path.- Use
python -m venv PATH
to create a venv in a directory.
- Use
pyvenv-deactivate
to deactivate a venv or a virtualenv.
- See inside the variable
flycheck-checkers
to see from which software check your code. For python the list includes python-flake8, python-pylint, python-pycompile, python-pyright, and python-mypy.