HAOS itself doesn’t have python, but the docker container named homeassistant which runs the “Home Assistant Core” indeed runs on python and is where you should do the pip install.
One of the most common ways to get inside that container is to go into the console of your HA machine and run: docker exec -it homeassistant /bin/bash. Be aware that when you upgrade the Core, you’ll likely have to pip reinstall again.
If you have a monitor and keyboard connected to the machine running HA, then you are connected to the “console”. Here you should have a command line prompt “#”. This is where you would enter the command I mentioned.
It’s a virtual machine so I do only have this connection.
I’ve tried and the IP of the virtual machine connects me directly to HA, I do not have any other interface
I apologize, I told you somewhat incorrectly… if you have a VM and have access to HA’s console using some kind of VM management system, you will get the HA CLI message along with the prompt “>”. Next type login and you should now see the # prompt.
If you don’t have a VM management system with access to the console, the SSH is your next alternative:
If you are using the “Update Advanced SSH & Web Terminal” AddOn with protection mode turned off, then you have access to the HAOS linux comand shell, and you can use the docker command I mentioned to get access to the HA Container. This would be my recommendation.
If you are using “Terminal & SSH” AddOn, this won’t work. (I think this is the one you are trying to use)
If you are using a command line shell to run ssh, this won’t work either unless you specify a special port using -p22222. But to use this, you have to setup SSH permission for the HAOS linux root which is not that easy to do.