You have two options here.
The first is to explicitly put the root user's local bin on the PATH with something like
The second is to drop the --user argument on your pip install. By default, pip should write to /usr/local/bin which will be on your PATH already
You should read about Docker and enroll in Docker Training to grasp the concept in detail.
If you are interested to learn Python from Industry experts, you can sign up for this Python Certification Course by Intellipaat.