0

I'm running circusd from my command-line with the following config file:

[circus]
debug=True

[watcher:flask]
cmd=python --version

[env:flask]
PATH=$PATH

The output is coming as Python 2.7.10.

Currently, my .bashrc file contains an alias setting python to Python 3. As a result, running the command directly on shell gives me the correct version of python:

$ python --version
Python 3.6.4

Is there any way I can get circus to import my aliases directly from bash config files?

I'm assuming there are ways to solve this issue through virtualenv, but I'm looking at a way to solve this through bash directly. Thanks!

shashwat
  • 992
  • 1
  • 13
  • 27
  • Setting `alias python=python3` in bashrc file is not good, aliases only work in interactive shells, which means that `bash -c 'python --version'` will still return `Python 2.7.10`. Isn't it better to change system wide with smth like `update-alternatives` to python3? Also you can just specify `cmd=python3 --version` to run python3 independently of the system. – KamilCuk Jun 24 '18 at 10:43
  • `update-alternatives` seems interesting! Is there a Mac command for the same? – shashwat Jun 25 '18 at 06:18

1 Answers1

0

launch an interactive login bash shell to run the command:

cmd=bash -lic 'python --version'
glenn jackman
  • 238,783
  • 38
  • 220
  • 352