前提
$ pyenv versions
system (2.7.16)
2.7.0
* 3.7.0 (set by /path/to/.pyenv/version)
Python 2.7.16 が呼ばれることを期待
$ python -m pip install -U robotframework
$ robot --version
Robot Framework 3.1.2 (Python 2.7.16 on darwin)
$ robot main.robot
[ ERROR ] Error in file 'path/to/main.robot': Importing test library 'path/to/DebugKeywords.py' failed: SyntaxError: invalid syntax (DebugKeywords.py, line 16)
↓
Python 3.7.0 が呼ばれることを期待
$ python3 -m pip install -U robotframework
$ robot --version
Robot Framework 3.1.2 (Python 3.7.0 on darwin)
$ robot main.robot
[ ERROR ] hello