Using sudo with pip3?

jim jf_byrnes at comcast.net
Sat Jan 7 13:22:45 EST 2017


On 01/06/2017 08:24 PM, Cameron Simpson wrote:
> On 06Jan2017 23:03, Clint Moyer <contact at clintmoyer.com> wrote:

Thanks everyone for the advice. Please note in my following comments I 
am not arguing with anyone, merely trying to understand. I am not a 
professional programmer, just someone who enjoys programing for my own 
use/enjoyment and I am the only user of this system.

>> Packages supplied by your distribution can be trusted more than packages
>> from PyPi. Just my two cents.
>> Most distros offer nearly all the useful Python modules directly from the
>> repo.
>
> I would agree with this on the whole. And also that it is generally
> better to add modules to your system python via the distro's repo
> because that bring benefit to every user on the system, not just yourself.

What is "system python"? If I do $ which python I get /usr/bin/python 
which points to python 2.7xx. So if everything I added was for python 3 
either using pip3 or apt-get would I be adding to "system python"?

I see that most of the "major" python3 modules I had installed, with the 
exception of scripy, are in the repository. If I upgraded one of the 
repository modules using pip3 would I lose the benefits of installing 
from the repository? I know it seems to be possible as I installed pip3 
from the repository.  The first time I used it to install a module it 
informed me there was a more current version available and showed me the 
command to update. I updated and it seems to be fine.

>> Virtual environments are great, but if you want to add libraries to your
>> system interpreter I'd recommend a simple sync through your repo.
>
> I'm directly advocating _not_ adding PyPI packages to the system
> interpreter.  If nothing else, they may differ in behaviour and
> potentially actually break system behaviour.
>
> Having your on virtualenv is good for: adding packages no provided by
> your vendor, adding packages deliberately different from those from your
> vendor (eg newer versions with specific bugfixes or extra features),
> having an isolated environment for packages (you can make more than one
> virtual environment).
>
> And of course it avoids interfering with your system python install.

A number of years ago I had virtualenv installed.  At the time I 
remember it took me a while to get it installed and working. Right now I 
am working on some scripts to download some financial date using 
Selenium and paste it into Libreoffice Calc spreadsheets.  Will using 
virtualenv have any effect on me running those scripts?

Thanks,  Jim

>
> Cheers,
> Cameron Simpson <cs at zip.com.au>




More information about the Python-list mailing list