Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8023 > unrolled thread

Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...

Started byBrian May <brian@linuxpenguins.xyz>
First post2015-12-30 10:30 +0100
Last post2016-01-03 00:40 +0100
Articles 8 — 5 participants

Back to article view | Back to linux.debian.maint.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie... Brian May <brian@linuxpenguins.xyz> - 2015-12-30 10:30 +0100
    Re: [Python-modules-team] My Pip installation is broken after  upgrading Debian from oldstable/Wheezy to stable/Jessie... Ant Dude <ant@zimage.com> - 2015-12-30 11:20 +0100
      Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie... Brian May <bam@debian.org> - 2016-01-02 00:40 +0100
        Re: [Python-modules-team] My Pip installation is broken after  upgrading Debian from oldstable/Wheezy to stable/Jessie... Ant Dude <ant@zimage.com> - 2016-01-02 01:00 +0100
        Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie... Daniele Tricoli <eriol@mornie.org> - 2016-01-02 16:40 +0100
          Re: [Python-modules-team] My Pip installation is broken after  upgrading Debian from oldstable/Wheezy to stable/Jessie... Ant Dude <ant@zimage.com> - 2016-01-02 17:40 +0100
            Re: [Python-modules-team] My Pip installation is broken after  upgrading Debian from oldstable/Wheezy to stable/Jessie... Andrey Rahmatullin <wrar@debian.org> - 2016-01-02 18:40 +0100
          Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie... Brian May <bam@debian.org> - 2016-01-03 00:40 +0100

#8023 — Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...

FromBrian May <brian@linuxpenguins.xyz>
Date2015-12-30 10:30 +0100
SubjectRe: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...
Message-ID<qLleW-4KR-3@gated-at.bofh.it>
Ant Dude <ant@zimage.com> writes:

> Dear Sir or Madam:
>
> Hello.
>
> A couple days ago, I upgraded my old Debian from oldstable/Wheezy to 
> stable/Jessie but its Pip now crashes as shown below:
>
> $ pip install
> Traceback (most recent call last):
> File "/usr/bin/pip", line 9, in
> load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
> File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in 
> load_entry_point
> return get_distribution(dist).load_entry_point(group, name)
> File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in 
> load_entry_point
> return ep.load()
> File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
> ['name'])
> File "/usr/lib/python2.7/dist-packages/pip/init.py", line 74, in
> from pip.vcs import git, mercurial, subversion, bazaar # noqa
> File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in
> from pip.download import path_to_url
> File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in
> from requests.compat import IncompleteRead
> ImportError: cannot import name IncompleteRead
>
> $ python
> Python 2.7.9 (default, Mar 1 2015, 12:57:24)
> [GCC 4.9.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>              exit
>              Use exit() or Ctrl-D (i.e. EOF) to exit
>
> How do I fix this? I already tried apt-get purge and reinstalling 
> python-pip, python-colorama, python-distlib, python-html5lib, 
> python-ndg-httpsclient, python-requests, python-urllib3, and 
> python-wheel packages. Pip worked before the upgrade. :(

Do you have any python packages installed under /usr/local? If so, this
could cause breakages as these files are outside the control of the
package manager.

In short, it isn't recommended practise to use pip install with Debian,
except for inside a virtualenv (or similar), as the packages can
conflict with Debian packages - especially after a upgrade.
-- 
Brian May <brian@linuxpenguins.xyz>
https://linuxpenguins.xyz/brian/

[toc] | [next] | [standalone]


#8024 — Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...

FromAnt Dude <ant@zimage.com>
Date2015-12-30 11:20 +0100
SubjectRe: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...
Message-ID<qLm1k-5j3-11@gated-at.bofh.it>
In reply to#8023
On Wed, Dec 30, 2015 at 08:23:56PM +1100, Brian May wrote:
> Ant Dude <ant@zimage.com> writes:
> 
> > Dear Sir or Madam:
> >
> > Hello.
> >
> > A couple days ago, I upgraded my old Debian from oldstable/Wheezy to 
> > stable/Jessie but its Pip now crashes as shown below:
> >
> > $ pip install
> > Traceback (most recent call last):
> > File "/usr/bin/pip", line 9, in
> > load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
> > File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in 
> > load_entry_point
> > return get_distribution(dist).load_entry_point(group, name)
> > File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in 
> > load_entry_point
> > return ep.load()
> > File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
> > ['name'])
> > File "/usr/lib/python2.7/dist-packages/pip/init.py", line 74, in
> > from pip.vcs import git, mercurial, subversion, bazaar # noqa
> > File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in
> > from pip.download import path_to_url
> > File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in
> > from requests.compat import IncompleteRead
> > ImportError: cannot import name IncompleteRead
> >
> > $ python
> > Python 2.7.9 (default, Mar 1 2015, 12:57:24)
> > [GCC 4.9.2] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >              exit
> >              Use exit() or Ctrl-D (i.e. EOF) to exit
> >
> > How do I fix this? I already tried apt-get purge and reinstalling 
> > python-pip, python-colorama, python-distlib, python-html5lib, 
> > python-ndg-httpsclient, python-requests, python-urllib3, and 
> > python-wheel packages. Pip worked before the upgrade. :(
> 
> Do you have any python packages installed under /usr/local? If so, this
> could cause breakages as these files are outside the control of the
> package manager.

I have no idea, Brian:

$ ls -all /usr/local
total 40
drwxr-xr-x 10 root staff 4096 Nov 24  2011 .
drwxr-xr-x 12 root root  4096 Jul  5  2013 ..
drwxr-xr-x  2 root staff 4096 Dec 29 16:15 bin
drwxrwsr-x  2 root staff 4096 Nov 24  2011 etc
drwxrwsr-x  2 root staff 4096 Nov 24  2011 games
drwxrwsr-x  2 root staff 4096 Nov 24  2011 include
drwxrwsr-x  8 root staff 4096 Dec 27 20:19 lib
lrwxrwxrwx  1 root staff    9 Nov 24  2011 man -> share/man
drwxrwsr-x  2 root staff 4096 Nov 24  2011 sbin
drwxrwsr-x 10 root staff 4096 Dec 27 20:19 share
drwxrwsr-x  2 root staff 4096 Nov 24  2011 src


> In short, it isn't recommended practise to use pip install with Debian,
> except for inside a virtualenv (or similar), as the packages can
> conflict with Debian packages - especially after a upgrade.

Interesting. I did find a fix and it seems like others had the same 
problem. FFrom Debian's forum, it said 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744145#31 -- rm -rf 
/usr/local/lib/python2.7/dist-packages/requests* I renamed request 
directory and now can run Debian's pip command. Sheesh. I also notice it 
is an old bug that is still not fixed. :(

Vest regards,
Ant

[toc] | [prev] | [next] | [standalone]


#8046

FromBrian May <bam@debian.org>
Date2016-01-02 00:40 +0100
Message-ID<qMhsC-um-5@gated-at.bofh.it>
In reply to#8024
Ant Dude <ant@zimage.com> writes:

>> In short, it isn't recommended practise to use pip install with Debian,
>> except for inside a virtualenv (or similar), as the packages can
>> conflict with Debian packages - especially after a upgrade.
>
> Interesting. I did find a fix and it seems like others had the same 
> problem. FFrom Debian's forum, it said 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744145#31 -- rm -rf 
> /usr/local/lib/python2.7/dist-packages/requests* I renamed request 
> directory and now can run Debian's pip command. Sheesh. I also notice it 
> is an old bug that is still not fixed. :(

Are you sure? This bug was supposedly fixed in the Jessie version...
-- 
Brian May <bam@debian.org>

[toc] | [prev] | [next] | [standalone]


#8047 — Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...

FromAnt Dude <ant@zimage.com>
Date2016-01-02 01:00 +0100
SubjectRe: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...
Message-ID<qMhLY-B4-19@gated-at.bofh.it>
In reply to#8046
> >> In short, it isn't recommended practise to use pip install with Debian,
> >> except for inside a virtualenv (or similar), as the packages can
> >> conflict with Debian packages - especially after a upgrade.
> >
> > Interesting. I did find a fix and it seems like others had the same 
> > problem. FFrom Debian's forum, it said 
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744145#31 -- rm -rf 
> > /usr/local/lib/python2.7/dist-packages/requests* I renamed request 
> > directory and now can run Debian's pip command. Sheesh. I also notice it 
> > is an old bug that is still not fixed. :(
> 
> Are you sure? This bug was supposedly fixed in the Jessie version...

Maybe it is a different issue? Pip is still working so far with that 
directory renamed:

$ ls /usr/local/lib/python2.7/dist-packages/requestsRENAMED -all
total 684
drwxr-sr-x  3 root staff   4096 Dec 21 07:10 .
drwxrwsr-x 49 root staff   4096 Jan  1 10:30 ..
-rw-r--r--  1 root staff  17495 Dec 21 07:10 adapters.py
-rw-r--r--  1 root staff  16160 Dec 21 07:10 adapters.pyc
-rw-r--r--  1 root staff   5419 Dec 21 07:10 api.py
-rw-r--r--  1 root staff   6194 Dec 21 07:10 api.pyc
-rw-r--r--  1 root staff   7550 Dec 21 07:10 auth.py
-rw-r--r--  1 root staff   8065 Dec 21 07:10 auth.pyc
-rw-r--r--  1 root staff 344712 Dec 21 07:10 cacert.pem
-rw-r--r--  1 root staff    613 Dec 21 07:10 certs.py
-rw-r--r--  1 root staff    883 Dec 21 07:10 certs.pyc
-rw-r--r--  1 root staff   1469 Dec 21 07:10 compat.py
-rw-r--r--  1 root staff   1691 Dec 21 07:10 compat.pyc
-rw-r--r--  1 root staff  17387 Dec 21 07:10 cookies.py
-rw-r--r--  1 root staff  21091 Dec 21 07:10 cookies.pyc
-rw-r--r--  1 root staff   2776 Dec 21 07:10 exceptions.py
-rw-r--r--  1 root staff   5974 Dec 21 07:10 exceptions.pyc
-rw-r--r--  1 root staff    767 Dec 21 07:10 hooks.py
-rw-r--r--  1 root staff   1212 Dec 21 07:10 hooks.pyc
-rw-r--r--  1 root staff   2007 Dec 21 07:10 __init__.py
-rw-r--r--  1 root staff   2664 Dec 21 07:10 __init__.pyc
-rw-r--r--  1 root staff  29277 Dec 21 07:10 models.py
-rw-r--r--  1 root staff  25836 Dec 21 07:10 models.pyc
drwxr-sr-x  4 root staff   4096 Dec 21 07:10 packages
-rw-r--r--  1 root staff  24544 Dec 21 07:10 sessions.py
-rw-r--r--  1 root staff  19948 Dec 21 07:10 sessions.pyc
-rw-r--r--  1 root staff   3280 Dec 21 07:10 status_codes.py
-rw-r--r--  1 root staff   4598 Dec 21 07:10 status_codes.pyc
-rw-r--r--  1 root staff   2977 Dec 21 07:10 structures.py
-rw-r--r--  1 root staff   5252 Dec 21 07:10 structures.pyc
-rw-r--r--  1 root staff  21845 Dec 21 07:10 utils.py
-rw-r--r--  1 root staff  21397 Dec 21 07:10 utils.pyc

[toc] | [prev] | [next] | [standalone]


#8050

FromDaniele Tricoli <eriol@mornie.org>
Date2016-01-02 16:40 +0100
Message-ID<qMwrD-1px-5@gated-at.bofh.it>
In reply to#8046

[Multipart message — attachments visible in raw view] — view raw

Hello,
sorry for the delay in my reply!

On Saturday, January 02, 2016 10:32:50 AM Brian May wrote:
> Are you sure? This bug was supposedly fixed in the Jessie version...

03_export-IncompleteRead.patch is still present in the requests packaging 
(since pip version in Debian still need it) and was shipped with requests 
2.4.3-2.

@Ant Dude: just to recap and to be sure I understand correctly: you should 
have installed requests 2.4.3-6 and python-pip (1.5.6-5), right?
Renaming requests (Debian packaged version) install directory make pip work, 
right?
Debian packaged version of pip doesn't use convenience copies, so do you have 
a version of requests installed not using apt?
Please can you tell me what is the output of the following?

    python -c "import requests; print requests.__version__"

Please, can you also try:

    python -c "from requests.compat import IncompleteRead"

Thanks!

-- 
 Daniele Tricoli 'eriol'
 https://mornie.org

[toc] | [prev] | [next] | [standalone]


#8051 — Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...

FromAnt Dude <ant@zimage.com>
Date2016-01-02 17:40 +0100
SubjectRe: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...
Message-ID<qMxnI-20F-7@gated-at.bofh.it>
In reply to#8050
On Sat, Jan 02, 2016 at 04:39:24PM +0100, Daniele Tricoli wrote:
> Hello,
> sorry for the delay in my reply!

Hi! No problems due to the holidays. ;)

 
> On Saturday, January 02, 2016 10:32:50 AM Brian May wrote:
> > Are you sure? This bug was supposedly fixed in the Jessie version...
> 
> 03_export-IncompleteRead.patch is still present in the requests packaging 
> (since pip version in Debian still need it) and was shipped with requests 
> 2.4.3-2.
> 
> @Ant Dude: just to recap and to be sure I understand correctly: you should 
> have installed requests 2.4.3-6 and python-pip (1.5.6-5), right?

Yes, but probably from Wheezy when before Jessie became the new stable. 
My dpkg -l shows:
ii  python-requests                       2.4.3-6                              all          elegant and simple HTTP library for Python2, built for human beings
ii  python-pip                            1.5.6-5                              all          alternative Python package installer


> Renaming requests (Debian packaged version) install directory make pip work, 
> right?

Yes.


> Debian packaged version of pip doesn't use convenience copies, so do you have 
> a version of requests installed not using apt?
> Please can you tell me what is the output of the following?
> 
>     python -c "import requests; print requests.__version__"
> 
> Please, can you also try:
> 
>     python -c "from requests.compat import IncompleteRead"

With /usr/local/lib/python2.7/dist-packages/requestsRENAMED
$ python -c "import requests; print requests.__version__"
2.4.3
$ python -c "from requests.compat import IncompleteRead"
$

With the original /usr/local/lib/python2.7/dist-packages/requests:
$ python -c "import requests; print requests.__version__"
2.9.1
$ python -c "from requests.compat import IncompleteRead"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name IncompleteRead

I tried "apt-get purge python-pip python-requests" and then reinstalling 
them to see if the problem would go away. Nope:
$ pip
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in 
load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, 
in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, 
in load
    ['__name__'])
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in 
<module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, 
in <module>
    from pip.download import path_to_url
  File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in 
<module>
    from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead


Again, I renamed the old requests directory for me to use pip again. :(

[toc] | [prev] | [next] | [standalone]


#8052 — Re: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...

FromAndrey Rahmatullin <wrar@debian.org>
Date2016-01-02 18:40 +0100
SubjectRe: [Python-modules-team] My Pip installation is broken after upgrading Debian from oldstable/Wheezy to stable/Jessie...
Message-ID<qMyjM-2Bz-17@gated-at.bofh.it>
In reply to#8051

[Multipart message — attachments visible in raw view] — view raw

On Sat, Jan 02, 2016 at 08:18:13AM -0800, Ant Dude wrote:
> Again, I renamed the old requests directory for me to use pip again. :(
Why don't you just uninstall the package you've installed manually to
/usr/local? It seems to me you don't need it.

-- 
WBR, wRAR

[toc] | [prev] | [next] | [standalone]


#8053

FromBrian May <bam@debian.org>
Date2016-01-03 00:40 +0100
Message-ID<qMDW9-67v-9@gated-at.bofh.it>
In reply to#8050
Daniele Tricoli <eriol@mornie.org> writes:

> @Ant Dude: just to recap and to be sure I understand correctly: you should 
> have installed requests 2.4.3-6 and python-pip (1.5.6-5), right?
> Renaming requests (Debian packaged version) install directory make pip work, 
> right?

He previously said he renamed the /usr/local version, not the packaged
version:

/usr/local/lib/python2.7/dist-packages/requestsRENAMED

I think he might be getting confused where the files are coming from and
the difference between "apt-get install python-xyz" vs "pip install
xyz".

So I will try to explain: If you install the package with "pip install
xyz" - it will get installed under /usr/local. However the Debian
package system doesn't understand this, and doesn't know that you have
done this. So you may have installed a version that is not compatible
with the Debian packages.

When you install a package with "apt-get install python-xyz" (including
security updates) it will get installed under /usr/lib. The package
system knows about these packages and will work to ensure that the
versions are compatible. However any packages you have installed locally
with "pip install xyz" in /usr/local will take priority and get used
instead. Even if they are not compatible.

So as a result, it is not a good idea to install any packages locally in
/usr/local - you should always install packages with "apt-get" as only
these packages are tested by Debian to work with Debian packages.

Just to confuse matters, there are some upstream packages - particular
those not yet in Debian, where the upstream authors do recommend
installing missing dependancies with "pip install xyz" - this is not
actually good practise.

Hope this helps.
-- 
Brian May <bam@debian.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web