Help: Pip, pip3, apt-get, sudo, sudo -H?

Hi there,

I’ve recently made a ubuntu server on a rockpi 4b. I want to use this server to give my ipad a true vnc and rdp desktop experience. My main goal is to use Spyer, Texmaker and Jupyter.
I’m currently trying to set everything up but i have found some difficulties installing python 3 libraries. I think this is due to the fact that i’m confused how python libraries are installed. There are so many different methods to do these installations (pip, pip3, apt-get) an then there is also the extremely annoying conflict between python and python3 installation candidates. Furthermore whenever i do a pip installation i can do this using the normal code, sudo + the normal code, and sudo +H + the normal code. I do understand the differences here, but I don’t understand what the ‘royal way’ is to do these installations. Futhermore, I’ve now installed libraries using all six methods (sudo, sudo +H and regular TIMES pip and pip3 = 6) so it feels like the library installations are a mess at this point.
The result is for example that my jupyter installation does not see my nbextensions.

Can anyone of you more experienced linux users please help me clarify what the ‘golden standard’ is for installing python3 modules? And what does one do to get order in the chaos at this point ? How can i find the different installation folders of python libraries? And how can I let python3 find the locations and use the libraries in those locations ?

I do know this is a rather vague question, a nice article or book would be just fine. The porblem is just, if I google solutions for my problems every writer uses a different method for installing modules, these might solve the problem in the short run, but cause problems in the long run.

Thank uoi in advance.

Johan

Hi Johan,

pip3 just an alias for pip.

Packages installed through apt are generally older versions.

Sometimes the system relies on a version of the package, and installing a new version of the package through pip may break the system dependency.

The best practice is using venv or pipenv .

1 Like