msherry / flycheck-pycheckers

Multiple syntax checker for Python in Emacs, using Flycheck
GNU General Public License v3.0
63 stars 23 forks source link

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

Open lbolla opened 3 years ago

lbolla commented 3 years ago

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?

rpgoldman commented 3 years ago

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.

lbolla commented 3 years ago

@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.