`it2api` requires a Python module, but no instructions for installing it are available
Bug report
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.5.0beta1
- OS version: Sonoma 14.1.1
- (haven't attached logs since the problem has been identified in code)
Detailed steps to reproduce the problem
After installing shell integration, an it2api
script is available. That script uses whatever python3
executable is on the $PATH
(which is good), and imports a package/module called iterm2
.
It doesn't look like iterm actually installed that module in any of my system's Python installations. Regardless, people use pyenv
and other Python "sites" which iterm2 will not be aware of. The script should gracefully handle the case where the module is not available.
What happened
$ it2api
Traceback (most recent call last):
File "./it2api", line 5, in <module>
import iterm2
ModuleNotFoundError: No module named 'iterm2'
What should have happened
Something to the effect of...
$ it2api
The current version of Python doesn't have the 'iterm2' module installed. Please run:
$ python3 -m pip install <correct-package-name>
(The 'install shell integration' function could run pip
for the user in the current Python environment (whatever that may be), but because of pyenv
, etc., but in my judgment, a helpful error message is still necessary, and probably sufficient.)
If George would be kind enough to confirm the correct package name for pip, and if it's not faster for him to to simply fix it himself, I can try to put together a pull request.