I’m installing a console command using the entry_point dict in setup.py. This creates a python file in some path in the system (for example, as root in debian is /usr/local/bin) that can change depending the system or if you use virtualenvs.
I need the default path of scripts installed as entry_points with setup.py
The location can vary depending on various arguments to
setup.py, including--home,--user,--prefix,--install-scriptsand so on.If the script already exists, the best way to find it would be to scan over the contents in
$PATH, looking for an executable file (like thewhichcommand), but this might not be what you’re afterThe distutils.sysconfig module might be more helpful.
..which is the directory where, for example
pyflakesends up if I runpip install pyflakesThe
get_config_varsdict might be useful if you need to find a more specific location:You can more conveniently access some of these variables via the
sysmodule, includingsys.prefixandsys.execprefix