Something's wrong with the package. Interactive mode, Python 3.5: >>> import requests Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python3.5/site-packages/requests/__init__.py", line 58, in <module> from . import utils File "/usr/lib64/python3.5/site-packages/requests/utils.py", line 32, in <module> from .exceptions import InvalidURL, FileModeWarning File "/usr/lib64/python3.5/site-packages/requests/exceptions.py", line 10, in <module> from .packages.urllib3.exceptions import HTTPError as BaseHTTPError ImportError: No module named 'requests.packages.urllib3.exceptions' As a result importing layman API fails when I use portage and installing dev-python/pip fails. Reproducible: Always Portage 2.2.27 (python 3.5.1-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-5.3.0, glibc-2.22-r1, 4.4.0-gentoo-r1melf x86_64) ================================================================= System uname: Linux-4.4.0-gentoo-r1melf-x86_64-Intel-R-_Core-TM-_i5-2400_CPU_@_3.10GHz-with-gentoo-2.2 KiB Mem: 16379788 total, 113640 free KiB Swap: 17825788 total, 17825588 free Timestamp of repository gentoo: Fri, 22 Jan 2016 11:45:02 +0000 sh bash 4.3_p42-r1 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1 app-shells/bash: 4.3_p42-r1::gentoo dev-java/java-config: 2.2.0::gentoo dev-lang/perl: 5.22.1::gentoo dev-lang/python: 2.7.11-r2::gentoo, 3.4.3-r7::gentoo, 3.5.1-r2::gentoo dev-util/cmake: 3.4.2::gentoo dev-util/pkgconfig: 0.29::gentoo sys-apps/baselayout: 2.2::gentoo sys-apps/sandbox: 2.10-r1::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r1::gentoo sys-devel/automake: 1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r1::gentoo sys-devel/binutils: 2.25.1-r1::gentoo sys-devel/gcc: 5.3.0::gentoo sys-devel/gcc-config: 1.8::gentoo sys-devel/libtool: 2.4.6-r1::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers) sys-libs/glibc: 2.22-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync1.ru.gentoo.org/gentoo-portage priority: -1000 devpump-gor location: /var/lib/layman/devpump-gor sync-type: laymansync sync-uri: https://github.com/DevPump/gentoo-overlay.git masters: gentoo priority: 50 jorgicio location: /var/lib/layman/jorgicio sync-type: laymansync sync-uri: https://github.com/jorgicio/jorgicio-gentoo.git masters: gentoo priority: 50 kde location: /var/lib/layman/kde sync-type: laymansync sync-uri: git://anongit.gentoo.org/proj/kde.git masters: gentoo priority: 50 sunrise location: /var/lib/layman/sunrise sync-type: laymansync sync-uri: git://anongit.gentoo.org/proj/sunrise-reviewed.git masters: gentoo priority: 50 tox-overlay location: /var/lib/layman/tox-overlay sync-type: laymansync sync-uri: git://github.com/Tox/gentoo-overlay-tox.git masters: gentoo priority: 50 custom location: /usr/local/portage masters: gentoo priority: 70 Installed sets: @fonts, @gui, @kdeapps, @python-extra, @vim, @virtualbox ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE MPEG-4 myspell-ru_RU-ALexanderLebedev freedist vim.org BitstreamCyberbit MSttfEULA grass-ipafonts free-noncomm CC-BY-NC-ND-3.0 CC-Sampling-Plus-1.0 google-chrome Oracle-BCLA-JavaSE RAR unRAR mac PUEL" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=native -mtune=native" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/ibus/component/simple.xml /var/spool/munin-async/.ssh" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -march=native -mtune=native" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--keep-going --quiet-build" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.bloodhost.ru/ http://mirror.yandex.ru/gentoo-distfiles/ http://mirror.leaseweb.com/gentoo/" INSTALL_MASK="/etc/init.d/ /etc/xinetd.d/" LANG="ru_RU.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j5" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="X a52 aac acl acpi alsa amd64 anthy berkdb bluetooth branding btrfs bzip2 cairo cdda cdr cjk cli cracklib crypt cryptsetup cups cxx dbus declarative djvu dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran gdbm gif git glamor gpm gstreamer gtk ibus iconv icu idn ipv6 jpeg kde kipi lcms libnotify lm_sensors mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp opus pam pango pcre pdf phonon plasma png policykit ppds pulseaudio python qml qt3support qt4 qt5 raw readline samba scanner sdl seccomp session spell sse sse2 ssl startup-notification subversion svg systemd tcpd telepathy tiff truetype udev udisks unicode upower usb v4l vorbis wayland widgets wxwidgets x264 x265 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB ru ja" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4 python3_5" QEMU_SOFTMMU_TARGETS="x86_64 i386" RUBY_TARGETS="ruby22 ruby23" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Created attachment 423620 [details, diff] requests-2.9.1_use_system_packages.patch Changes lines in ~dev-python/requests-2.9.1 from '.packages.urllib3.foo import bar' to 'from urllib3.foo import bar'
Patch worked for me.
The patch is not what we want. It should and does work without. Which version of urllib3 are you using?
Which versions of dev-python/requests dev-python/urllib3 can reproduce this issue?
(In reply to Justin Lecher from comment #4) > Which versions of > > dev-python/requests > dev-python/urllib3 > > can reproduce this issue? I use the following, but the bug should show up with any version of urllib3 and layman: dev-python/requests-2.9.1-r2 dev-python/urllib3-1.14 app-portage/layman-2.3.0-r1 Just typing "layman" in a shell, I get: File "/usr/lib/python-exec/python3.5/layman", line 29, in <module> from layman.argsparser import ArgsParser File "/usr/lib64/python3.5/site-packages/layman/__init__.py", line 13, in <module> from layman.api import LaymanAPI File "/usr/lib64/python3.5/site-packages/layman/api.py", line 25, in <module> from layman.remotedb import RemoteDB File "/usr/lib64/python3.5/site-packages/layman/remotedb.py", line 46, in <module> from sslfetch.connections import Connector File "/usr/lib64/python3.5/site-packages/sslfetch/connections.py", line 40, in <module> import requests File "/usr/lib64/python3.5/site-packages/requests/__init__.py", line 58, in <module> from . import utils File "/usr/lib64/python3.5/site-packages/requests/utils.py", line 32, in <module> from .exceptions import InvalidURL, FileModeWarning File "/usr/lib64/python3.5/site-packages/requests/exceptions.py", line 10, in <module> from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
(In reply to Peter Levine from comment #5) > dev-python/requests-2.9.1-r2 > dev-python/urllib3-1.14 > app-portage/layman-2.3.0-r1 > > Just typing "layman" in a shell, I get: What is the output of "python -c "import requests"? Does reinstalling requests and urllib3 help?
I have those versions as well: python 3.5.1 requests 2.9.1-r2 urllib3 1.14 Reinstalling doesn't help. My "import requests" is in the first post...
(In reply to Justin Lecher from comment #6) > (In reply to Peter Levine from comment #5) > > dev-python/requests-2.9.1-r2 > > dev-python/urllib3-1.14 > > app-portage/layman-2.3.0-r1 > > > > Just typing "layman" in a shell, I get: > > What is the output of "python -c "import requests"? Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python3.5/site-packages/requests/__init__.py", line 58, in <module> from . import utils File "/usr/lib64/python3.5/site-packages/requests/utils.py", line 32, in <module> from .exceptions import InvalidURL, FileModeWarning File "/usr/lib64/python3.5/site-packages/requests/exceptions.py", line 10, in <module> from .packages.urllib3.exceptions import HTTPError as BaseHTTPError ImportError: No module named 'requests.packages.urllib3.exceptions'
When I switch the main active interpreter from python-3.5 to python-2.7, it seems to fix the problem.
The problem seems to be python-3.5. I installed python-3.4 along with dev-python/requests-2.9.1-r2, app-portage/layman, and dependencies, using PYTHON_TARGETS="python2_7 python3_4 python3_5". There's no bug if my active interpreter is set to python2.7 or python3.4. It shows up, however, if I set it to python3.5.
what is the output of find /usr/lib*/python*/site-packages/requests ?
Created attachment 423970 [details] find /usr/lib*/python*/site-packages/requests
Importing works with Python 3.4 and my system Python is set to 3.5 (eselect python).
Comment on attachment 423970 [details] find /usr/lib*/python*/site-packages/requests >/usr/lib64/python3.5/site-packages/requests/packages/urllib3 >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__ >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__/__init__.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__/connection.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__/request.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__/response.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__/ssl_.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__/timeout.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__/retry.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/util/__pycache__/url.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/contrib >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/contrib/__pycache__ >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/contrib/__pycache__/__init__.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/contrib/__pycache__/pyopenssl.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/packages >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/packages/ssl_match_hostname >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/__pycache__ >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/packages/__pycache__ >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/packages/__pycache__/__init__.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/packages/__pycache__/six.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__ >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/__init__.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/connectionpool.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/exceptions.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/connection.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/request.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/filepost.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/fields.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/response.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/_collections.cpython-35.opt-1.pyc >/usr/lib64/python3.5/site-packages/requests/packages/urllib3/__pycache__/poolmanager.cpython-35.opt-1.pyc For some strange reason you still have the bundled urllib3 installed on your system. Please run rm -r /usr/lib64/python3.5/site-packages/requests/packages/urllib3 and try again.
Ok, marking resolved.
Wierd. Lucky I saw this before and new to search for closed bugs or I might not have figured this out for years. Why is it doing that?
(In reply to Greg Turner from comment #16) > Wierd. Lucky I saw this before and new knew*