[Python-modules-team] Bug#832626: python-requests: Importing the module fails

Daniele Tricoli eriol at mornie.org
Wed Jul 27 22:22:26 UTC 2016


tag 832626 + moreinfo
thanks

Hello Michel,

On Wednesday, July 27, 2016 09:29:21 PM Michel Le Bihan wrote:
> Package: python-requests
> Version: 2.10.0-2
> Severity: grave
> Justification: renders package unusable
> 
> >>> import requests
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 61, in
> <module>
>     from .packages.urllib3.exceptions import DependencyWarning
> ImportError: cannot import name DependencyWarning

Please, can you show your sys.path?
I'm not able to riproduce your problem.

❯ python -c "import requests; print requests.__version__"
2.10.0
❯ python -c "from requests.packages.urllib3.exceptions import DependencyWarning; print DependencyWarning"
<class 'requests.packages.urllib3.exceptions.DependencyWarning'>

It's also working on a clean pbuilder chroot:

I: Building the build Environment
I: extracting base tarball [/var/cache/pbuilder/base.tgz]
I: copying local configuration
I: mounting /proc filesystem
I: mounting /sys filesystem
I: mounting /run/shm filesystem
I: mounting /dev/pts filesystem
I: Mounting /home/eriol/devel/debian/deps
I: policy-rc.d already exists
W: no hooks of type H found -- ignoring
I: Obtaining the cached apt archive contents
I: entering the shell
I: File extracted to: /var/cache/pbuilder/build/7695
W: no hooks of type F found -- ignoring
root at mornie:/# apt install python-requests
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ca-certificates libexpat1 libffi6 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libssl1.0.2 mime-support
  openssl python python-chardet python-minimal python-pkg-resources python-six python-urllib3 python2.7
  python2.7-minimal
Suggested packages:
  python-doc python-tk python-setuptools python-ndg-httpsclient python-openssl python-pyasn1 python-socks python-ntlm
  python2.7-doc binfmt-support
Recommended packages:
  file python-ndg-httpsclient python-openssl python-pyasn1
The following NEW packages will be installed:
  ca-certificates libexpat1 libffi6 libpython-stdlib libpython2.7-minimal libpython2.7-stdlib libssl1.0.2 mime-support
  openssl python python-chardet python-minimal python-pkg-resources python-requests python-six python-urllib3 python2.7
  python2.7-minimal
0 upgraded, 18 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/6798 kB of archives.
After this operation, 24.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Preconfiguring packages ...
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 12977 files and directories currently installed.)
Preparing to unpack .../libpython2.7-minimal_2.7.12-1_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.12-1) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../python2.7-minimal_2.7.12-1_amd64.deb ...
Unpacking python2.7-minimal (2.7.12-1) ...
Selecting previously unselected package python-minimal.
Preparing to unpack .../python-minimal_2.7.11-2_amd64.deb ...
Unpacking python-minimal (2.7.11-2) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../mime-support_3.60_all.deb ...
Unpacking mime-support (3.60) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../libexpat1_2.2.0-1_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.0-1) ...
Selecting previously unselected package libffi6:amd64.
Preparing to unpack .../libffi6_3.2.1-4_amd64.deb ...
Unpacking libffi6:amd64 (3.2.1-4) ...
Selecting previously unselected package libssl1.0.2:amd64.
Preparing to unpack .../libssl1.0.2_1.0.2h-1_amd64.deb 
Unpacking libssl1.0.2:amd64 (1.0.2h-1) ...                                                                                                                                                     
Selecting previously unselected package libpython2.7-stdlib:amd64.                                                                                                                             
Preparing to unpack .../libpython2.7-stdlib_2.7.12-1_amd64.deb ...                                                                                                                             
Unpacking libpython2.7-stdlib:amd64 (2.7.12-1) ...                                                                                                                                             
Selecting previously unselected package python2.7.                                                                                                                                             
Preparing to unpack .../python2.7_2.7.12-1_amd64.deb ...                                                                                                                                       
Unpacking python2.7 (2.7.12-1) ...                                                                                                                                                             
Selecting previously unselected package libpython-stdlib:amd64.                                                                                                                                
Preparing to unpack .../libpython-stdlib_2.7.11-2_amd64.deb ...                                                                                                                                
Unpacking libpython-stdlib:amd64 (2.7.11-2) ...                                                                                                                                                
Processing triggers for libc-bin (2.23-4) ...                                                                                                                                                  
Setting up libpython2.7-minimal:amd64 (2.7.12-1) ...                                                                                                                                           
Setting up python2.7-minimal (2.7.12-1) ...                                                                                                                                                    
Setting up python-minimal (2.7.11-2) ...                                                                                                                                                       
Selecting previously unselected package python.                                                                                                                                                
(Reading database ... 13783 files and directories currently installed.)                                                                                                                        
Preparing to unpack .../python_2.7.11-2_amd64.deb ...                                                                                                                                          
Unpacking python (2.7.11-2) ...                                                                                                                                                                
Selecting previously unselected package openssl.                                                                                                                                               
Preparing to unpack .../openssl_1.0.2h-1_amd64.deb ...                                                                                                                                         
Unpacking openssl (1.0.2h-1) ...                                                                                                                                                               
Selecting previously unselected package ca-certificates.                                                                                                                                       
Preparing to unpack .../ca-certificates_20160104_all.deb ...                                                                                                                                   
Unpacking ca-certificates (20160104) ...
Selecting previously unselected package python-pkg-resources.
Preparing to unpack .../python-pkg-resources_20.10.1-1.1_all.deb ...
Unpacking python-pkg-resources (20.10.1-1.1) ...
Selecting previously unselected package python-chardet.
Preparing to unpack .../python-chardet_2.3.0-2_all.deb ...
Unpacking python-chardet (2.3.0-2) ...
Selecting previously unselected package python-six.
Preparing to unpack .../python-six_1.10.0-3_all.deb ...
Unpacking python-six (1.10.0-3) ...
Selecting previously unselected package python-urllib3.
Preparing to unpack .../python-urllib3_1.15.1-2_all.deb ...
Unpacking python-urllib3 (1.15.1-2) ...
Selecting previously unselected package python-requests.
Preparing to unpack .../python-requests_2.10.0-2_all.deb ...
Unpacking python-requests (2.10.0-2) ...
Setting up libexpat1:amd64 (2.2.0-1) ...
Setting up mime-support (3.60) ...
Setting up libssl1.0.2:amd64 (1.0.2h-1) ...
Setting up openssl (1.0.2h-1) ...
Setting up libffi6:amd64 (3.2.1-4) ...
Setting up ca-certificates (20160104) ...
Setting up libpython2.7-stdlib:amd64 (2.7.12-1) ...
Setting up python2.7 (2.7.12-1) ...
Setting up libpython-stdlib:amd64 (2.7.11-2) ...
Setting up python (2.7.11-2) ...
Setting up python-pkg-resources (20.10.1-1.1) ...
Setting up python-six (1.10.0-3) ...
Setting up python-urllib3 (1.15.1-2) ...
Setting up python-chardet (2.3.0-2) ...
Setting up python-requests (2.10.0-2) ...
Processing triggers for libc-bin (2.23-4) ...
Processing triggers for ca-certificates (20160104) ...
Updating certificates in /etc/ssl/certs...
173 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
root at mornie:/# python
Python 2.7.12 (default, Jun 29 2016, 08:18:26) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> requests.__version__
'2.10.0'

Cheers,

-- 
 Daniele Tricoli 'eriol'
 https://mornie.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20160728/0c4c9c3c/attachment.sig>


More information about the Python-modules-team mailing list