reddit / emacs

Installing Python support on Doom - which Python version and what built-in packages provide Python supprt?

vfclists · 2022-09-22 21:56
I'm a bit of Python newbie wanting to get into Django and Wagtail and need configure Python in Doom. I uncommented Python and running `doom doctor` came up with some errors about some addons. > :lang python ! Couldn't find isort. Import sorting will not work. ! Couldn't find pipenv. pipenv support will not work. ! Couldn't find nosetests. Running tests through nose will not work. ! Couldn't find pytest. Running tests through pytest will not work. I suspect running pip to install the necessary python and emacs packages will fix those. Until `LSP` and `pyls` are installed is Python support provided by `flycheck` or some package installed by default? A worry I have is to know if what Doom did used Python 2 or Python 3 as both are installed on my system. I also saw some `pip` messages and perhaps that also involves Python 2 Is that something I need to worry about now, or can that be deferred till later?
Ok-Analysis-7820 · 2022-09-23 09:29
Go to your init file and push K on python. Go to installation, or if not that poke around. You'll see what you need
podtatranec · 2022-09-23 14:26
Generally speaking - if you are just starting out in your python/django journey you might not need integration of those tools. Afaik they are all optional and if you are not using them it's not the end of the world. That said they can be quite convenient (i.e. isort keeping your imports nice and tidy automatically etc). I would suggest not pip-installing the dependencies randomly though. If your distribution has them and you need them - install using package manager. Later on you will likely start using virtual environments (using poetry/pipenv or some other tool). And then those tools will likely be used from those venvs. Re python2/3 - I haven't had to configure that manually, though it's been a while since I was coding anything on python 2.... There are various variables that decide which python command gets used and you can override (perhaps in .dir-locals.el in worst case).