Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Problem with updating 'pip' packages

  1. #1
    heyjoe NNTP User

    Question Problem with updating 'pip' packages

    I was looking for a way to update all packages installed using pip and found this. For some time I have been using it and although it used to throw some error messages the programs seem to work fine. But today I noticed that one of the installed programs (streamlink) stopped to work:

    http://susepaste.org/c4ac7042

    Then I ran as root:

    http://susepaste.org/5f455f8a

    Quite a few errors as you can see.

    How can I fix this mess please? (my Leap 42.3 system is up to date, zypper-wise)

  2. #2
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,925
    Blog Entries
    14

    Default Re: Problem with updating 'pip' packages

    Don't have a real solution, but AFAICS the only culprit is urllib3, but the weird thing is that 1.23 meets the >=1.21.1
    Where ( from which repo ) did you install the python* packages? If not from the distro, did you do a vendor change on that repo ?
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  3. #3
    heyjoe NNTP User

    Default Re: Problem with updating 'pip' packages

    Quote Originally Posted by Knurpht View Post
    Don't have a real solution, but AFAICS the only culprit is urllib3, but the weird thing is that 1.23 meets the >=1.21.1
    I tried to remove urlllib3 using 'pip uninstall', then installed python3-urllib3 using zypper:

    Code:
    # zypper in python3-urllib3
    Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    
    The following NEW package is going to be installed:
      python3-urllib3
    
    1 new package to install.
    Overall download size: 138.8 KiB. Already cached: 0 B. After the operation, additional 530.2 KiB will be used.
    Continue? [y/n/...? shows all options] (y): y
    Retrieving package python3-urllib3-1.19.1-1.1.noarch                                                                                                                                                                    (1/1), 138.8 KiB (530.2 KiB unpacked)
    Retrieving: python3-urllib3-1.19.1-1.1.noarch.rpm ........................................................[done]
    Checking for file conflicts: .............................................................................[done]
    (1/1) Installing: python3-urllib3-1.19.1-1.1.noarch ......................................................[done]
    #
    Then I ran again the command which updates all the pip packages and I got the same error. Also at the end of it 'pip list' shows again urllib 1.23.

    Where ( from which repo ) did you install the python* packages? If not from the distro, did you do a vendor change on that repo ?
    I have no idea how pip installs things to be honest. How can I check? As for zypper the list is:

    Code:
    # zypper lr --uri
    Repository priorities are without effect. All enabled repositories share the same priority.
    
    #  | Alias                               | Name                    | Enabled | GPG Check | Refresh | URI                                                                                  
    ---+-------------------------------------+-------------------------+---------+-----------+---------+--------------------------------------------------------------------------------------
     1 | *Src-Non-OSS                        | *Src (Non-OSS)          | No      | ----      | ----    | http://download.opensuse.org/source/distribution/leap/42.3/repo/non-oss/             
     2 | KDE:Extra                           | KDE:Extra               | Yes     | (r ) Yes  | No      | http://download.opensuse.org/repositories/KDE:/Extra/openSUSE_Leap_42.3/             
     3 | RawTherapee                         | RawTherapee             | Yes     | (r ) Yes  | No      | http://download.opensuse.org/repositories/home:/rawtherapee/openSUSE_Leap_42.3/      
     4 | download.nvidia.com-leap            | nVidia Graphics Drivers | Yes     | (r ) Yes  | Yes     | http://download.nvidia.com/opensuse/leap/42.3                                        
     5 | download.opensuse.org-non-oss       | *Main (Non-OSS)         | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/42.3/repo/non-oss/                    
     6 | download.opensuse.org-non-oss_1     | *Update (Non-OSS)       | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/42.3/non-oss/                               
     7 | download.opensuse.org-oss           | *Main (OSS)             | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/42.3/repo/oss/                        
     8 | download.opensuse.org-oss_1         | *Update (OSS)           | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/42.3/oss/                                   
     9 | ftp.gwdg.de-suse                    | Packman                 | Yes     | (r ) Yes  | Yes     | http://packman.inode.at/suse/openSUSE_Leap_42.3/                                     
    10 | http-download.opensuse.org-ab86e53a | server:mail             | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/repositories/server:/mail/openSUSE_Leap_42.3/           
    11 | repo-debug                          | *Debug (OSS)            | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/debug/distribution/leap/42.3/repo/oss/                  
    12 | repo-debug-non-oss                  | *Debug (Non-OSS)        | No      | ----      | ----    | http://download.opensuse.org/debug/distribution/leap/42.3/repo/non-oss/              
    13 | repo-debug-update                   | *Debug-Update (OSS)     | No      | ----      | ----    | http://download.opensuse.org/debug/update/leap/42.3/oss/                             
    14 | repo-debug-update-non-oss           | *Debug-Update (Non-OSS) | No      | ----      | ----    | http://download.opensuse.org/debug/update/leap/42.3/non-oss/                         
    15 | repo-source                         | *Src (OSS)              | No      | ----      | ----    | http://download.opensuse.org/source/distribution/leap/42.3/repo/oss/                 
    16 | server:php:extensions               | server:php:extensions   | Yes     | (r ) Yes  | No      | http://download.opensuse.org/repositories/server:/php:/extensions/openSUSE_Leap_42.3/

  4. #4
    heyjoe NNTP User

    Default Re: Problem with updating 'pip' packages

    I just found:

    Code:
    # pip show urllib3
    Name: urllib3
    Version: 1.23
    Summary: HTTP library with thread-safe connection pooling, file post, and more.
    Home-page: https://urllib3.readthedocs.io/
    Author: Andrey Petrov
    Author-email: andrey.petrov@shazow.net
    License: MIT
    Location: /usr/lib/python3.4/site-packages
    Requires: 
    Required-by: requests
    I hope this provides the feedback you need.

  5. #5
    heyjoe NNTP User

    Default Re: Problem with updating 'pip' packages

    Tried to update pip itself (worked) and then to update all pip packages (no errors this time). Strangely - now the list of packages is much much longer:

    http://susepaste.org/bd3626a2

    And streamlink still throws the same errors.

    Then I ran again the command updating all packages - new errors appeared. Final result - streamlink still doesn't work, now even 'pip list' is broken (as well as the pip command itself):

    http://susepaste.org/40ead459

  6. #6
    heyjoe NNTP User

    Default Re: Problem with updating 'pip' packages

    I think I found a way to clean up the mess.

    Force reinstalled python(3)-pip from yast,
    updated it through 'pip install --upgrade pip'
    removed all pip packages which could be removed, then installed only those which I need.

    Lesson learned: Obviously one needs to be careful with commands which update things.

  7. #7

    Default Re: Problem with updating 'pip' packages

    On 2018-06-07, heyjoe <heyjoe@no-mx.forums.microfocus.com> wrote:
    > Lesson learned: Obviously one needs to be careful with commands which
    > update things.


    Glad things are working for you. However, as a long-time Python programmer I'm going to suggest a different solution.
    Never PIP-install anything as root. While PIP installations can be convenient just to get the job done, they can wreak
    havoc with GNU/Linux package managers especially when it comes to upgrading. If you can't install the necessary package
    with YaST/zypper and you need to pip install, run this as user:

    Code:
    user $ pip install --user <package>
    This will install the package in the user's ~/.local/ directory. Also consider virtualenv (although I don't use it).


  8. #8
    heyjoe NNTP User

    Default Re: Problem with updating 'pip' packages

    @flymail - thanks for the info.

    The reason I am installing as root is because I was running into issues previously when trying as normal user and I was told that 'pip install' must be run as root.

    Now you say the opposite. Perhaps both methods have pros and cons. As a non-python programmer I can only think of: doing less things as root makes sense. However I don't like packages to be installed in ~/.local because I try to keep my daily backups of my actual data in $HOME and .local is backed up too. I don't want to backup software which I have not written myself (i.e. downloadable scritps/binaries by others). Can you recommend a method for installing all the pip packages in a particular directory, for example ~/pip? Then I can set a rule for not backing that up. I was reading through 'pip help install' but can't figure the right option for it.

  9. #9
    heyjoe NNTP User

    Default Re: Problem with updating 'pip' packages

    I noticed that now torbrowser-launcher doesn't work. I tried forcefully updating it through yast but that changed nothing:

    Code:
    [~]: torbrowser-launcher 
    Traceback (most recent call last):
      File "/usr/bin/torbrowser-launcher", line 29, in <module>
        import torbrowser_launcher
      File "/usr/lib/python2.7/site-packages/torbrowser_launcher/__init__.py", line 33, in <module>
        from .common import Common, SHARE
      File "/usr/lib/python2.7/site-packages/torbrowser_launcher/common.py", line 55, in <module>
        from twisted.internet import gtk2reactor
      File "/usr/lib64/python2.7/site-packages/twisted/internet/gtk2reactor.py", line 23, in <module>
        from twisted.internet import _glibbase
      File "/usr/lib64/python2.7/site-packages/twisted/internet/_glibbase.py", line 20, in <module>
        from twisted.internet import base, posixbase, selectreactor
      File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 18, in <module>
        from twisted.internet import error, udp, tcp
      File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 28, in <module>                        
        from twisted.internet._newtls import (                                                                       
      File "/usr/lib64/python2.7/site-packages/twisted/internet/_newtls.py", line 21, in <module>                    
        from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol                                  
      File "/usr/lib64/python2.7/site-packages/twisted/protocols/tls.py", line 41, in <module>                       
        from OpenSSL.SSL import Error, ZeroReturnError, WantReadError                                                
      File "/usr/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>                               
        from OpenSSL import rand, crypto, SSL                                                                        
      File "/usr/lib/python2.7/site-packages/OpenSSL/SSL.py", line 124, in <module>                                  
        SSL_ST_INIT = _lib.SSL_ST_INIT                                                                               
    AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
    Any idea how to fix that?

  10. #10

    Default Re: Problem with updating 'pip' packages

    On 2018-06-07, heyjoe <heyjoe@no-mx.forums.microfocus.com> wrote:
    > @flymail - thanks for the info.


    Pleasure.

    > The reason I am installing as root is because I was running into issues
    > previously when trying as normal user and I was 'told'
    > (http://tinyurl.com/yctcbay8) that 'pip install' must be run as root.


    .... which kinda puts me in a difficult situation because Malcolm Lewis knows a lot more than me. I have used PIP on many
    different GNU/Linux systems and know from experience that PIP installation as root has lead to many troubles. Perhaps
    openSUSE is more resistant to these troubles for reasons I am unaware.


    > However I don't like packages to be installed in ~/.local
    > because I try to keep my daily backups of my actual data in $HOME and
    > .local is backed up too. I don't want to backup software which I have
    > not written myself (i.e. downloadable scritps/binaries by others).


    I think this is laudable, but bear in mind all your $HOME/.directories are also being backed up which include scripts,
    temporary files, and configuration files which you did not write yourself. I think the best solution to this approach is
    to change your back up system so it backs-up everything _except_ $HOME/.* .

    > Can you recommend a method for installing all the pip packages in a
    > particular directory, for example ~/pip? Then I can set a rule for not
    > backing that up. I was reading through 'pip help install' but can't
    > figure the right option for it.


    I would probably recommend a different approach entirely if you want to avoid installing packages to $HOME along the
    following lines:

    Code:
    $ su -
    # mkdir -p /opt/<user>/site-packages
    # chown -hR <user> /opt/<user>/site-packages
    # exit
    $ mkdir -p ~/.local/lib/python3.4/
    $ cd ~/.local/lib/python3.4/
    $ ln -s /opt/<user>/site-packages
    $ ls -l
    $ pip install --user <package>
    $ ls -lrth site-packages
    $ python3
    >>> import <package>
    >>> exit()
    $ cd ~/
    .... so in effect symlink to /opt/<user>/site-packages from $HOME.

    But I would still prefer the approach I've suggested above of backing up everything apart from $HOME/.* ...


Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •