flycheck-pycheckers icon indicating copy to clipboard operation
flycheck-pycheckers copied to clipboard

bin/pycheckers.py script fails if no python is available

Open lbolla opened this issue 4 years ago • 2 comments

On Ubuntu 20.04 a "python" executable is not available. Instead, "python3" is, by default. Therefore, bin/pycheckers.py, which uses the preamble:

#!/usr/bin/env python

fails on new Ubuntu installations. Manually amending it works. People may be reluctant to mess with system-wide Python installations and create a "python" executable (symlink to python3), for fear of breaking their system. What is the recommended way of handling this problem?

lbolla avatar Dec 09 '20 10:12 lbolla

Would it be possible to do the equivalent of

EXPORT python=/usr/local/bin/python3

in your Emacs to make this work?

Alternatively, couldn't you work in a virtual environment with the local python being python3? Then if emacs uses the right virtual environment the scripts will work.

rpgoldman avatar Dec 09 '20 16:12 rpgoldman

@rpgoldman I guess I can. In fact, I use pyvenv-workon to select a virtualenv for each project: at that point, "python" points to whatever Python executable the venv is using, either v2 or v3. So, this is not a big problem if using pyvenv. The bug is mostly about user friendliness, I guess.

lbolla avatar Dec 09 '20 17:12 lbolla