Like @ccc and @JonB already explained, subprocess can not really be used with pythonista. There is however a workaround. StaSh (a bash-like shell) provides a command called monkeylord, which can be used to emulate subprocess behaviour, albeit still limited and maybe only working with python 2.
If you are interested in trying this fake subprocess module, install StaSh, then in StaSh run monkeylord enable subprocess, then run python <path to your file here>. In this case, subprocess will use StaSh as a shell instead of the system shell. Due to this, the exact behavior may differ from a PC. Also, the last work on this was done in 2016, so it may be outdated.
(invalid syntax on pip)
Just so you know: The shell in pythonista (when you swipe from right to left in the editor) is a python shell, not a bash shell. It can be used to execute python code (e.g. print(2**10 % 3)), but not shell commands like pip or echo. Use StaSh for such cases instead.
@JonB said:
(or maybe bennr's fork)
Thanks for the mention, but most of the code in my fork is/will be merged back into the main repo (I got maintainer access)..