4 ms·
Which OS are you using? On Ubuntu, I get this useful output: $ python2 -m ensurepip --user ensurepip is disabled in Debian/Ubuntu for the system python.
by Flimm 10y ago
Which OS are you using? On Ubuntu, I get this useful output:
$ python2 -m ensurepip --user
ensurepip is disabled in Debian/Ubuntu for the system python.
Python modules For the system python are usually handled by dpkg and apt-get.
apt-get install python-<module name>
Install the python-pip package to use pip itself. Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.
- tux1968 10y agoInteresting. On Fedora here, and it actually includes version 3.4 of python with the command name "python3", and the above instructions worked just fine using it. However, now you have me worried that the article left out caveats and warnings about how these commands might lead to "unexpected results".
- Macha 10y agoThe worry is: 1. Install system python 2. Install pip from somewhere 3. pip install requests 4. apt-get install something with depends on python-requests Should the installation of apt's requests fail? Should it work but clobber your pip installed requests? What happens when the apt version is older than the pip version? Does this break whatever you used pip install requests for? There's two resolutions to this issue. 1. Don't use pip, always use apt for your python dependencies. The Ubuntu devs would really prefer you pick this option but not everything on pypi is on their repo and sometimes working consistently across platforms is more about than within platform consistency. 2. Use a different python environment than the system python. This could be done by using virtualenv, a different python version or a separate installation.
- rspeer 10y agoIt's upsetting that Ubuntu is so opposed to ensurepip that they won't even let it work in user mode. There is no way to use these Python standard library features without being root and installing separate Ubuntu packages. This was Ubuntu bug #1290847, which is now marked as "Fix Released": they consider the current behavior okay. Python packaging is good now, except on Ubuntu.
- Flimm 10y agoHow does Debian do it?
- rlpb 10y agoThe same people who look after Python in Ubuntu also look after Python in Debian (as part of a wider team) and also are active upstream in Python in making Python work well across all distributions. Ubuntu is hardly on its own here. I recommend that anyone who disagrees with how Python is packaged on Debian and Ubuntu get in touch on the relevant mailing lists. If you think it's wrong, there's probably a use case you're missing, or you'll find that your proposal will badly break some other expected behaviour.