Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 551450 - dev-python/d2to1-0.2.11:ImportError: cannot import name urllib_parse
Summary: dev-python/d2to1-0.2.11:ImportError: cannot import name urllib_parse
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-07 17:54 UTC by Toralf Förster
Modified: 2017-01-17 11:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge history (dev-python-d2to1-0.2.11-20150607-173026.pks,271.19 KB, text/plain)
2015-06-07 17:54 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2015-06-07 17:54:10 UTC
Created attachment 404750 [details]
emerge history

* Repository: gentoo
 * Maintainer: python@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux python_targets_python2_7 python_targets_python3_3 userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking d2to1-0.2.11.tar.gz to /var/tmp/portage/dev-python/d2to1-0.2.11/work
>>> Source unpacked in /var/tmp/portage/dev-python/d2to1-0.2.11/work
>>> Preparing source in /var/tmp/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11 ...
 * python3_3: running distutils-r1_run_phase distutils-r1_python_compile
/usr/bin/python3.3 setup.py build
Traceback (most recent call last):
  File "setup.py", line 13, in <module>
    setup(**cfg_to_args())
  File "/var/tmp/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11/d2to1/util.py", line 204, in cfg_to_args
    wrap_commands(kwargs)
  File "/var/tmp/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11/d2to1/util.py", line 439, in wrap_commands
    for cmd, _ in dist.get_command_list():
  File "/usr/lib64/python3.3/distutils/dist.py", line 749, in get_command_list
    klass = self.get_command_class(cmd)
  File "/usr/lib64/python3.3/site-packages/setuptools/dist.py", line 430, in get_command_class
    self.cmdclass[command] = cmdclass = ep.load()
  File "/usr/lib64/python3.3/site-packages/pkg_resources/__init__.py", line 2345, in load
    return self.resolve()
  File "/usr/lib64/python3.3/site-packages/pkg_resources/__init__.py", line 2351, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib64/python3.3/site-packages/readme/integration/distutils.py", line 20, in <module>
    from readme.rst import render
  File "/usr/lib64/python3.3/site-packages/readme/rst.py", line 23, in <module>
    from .clean import clean
  File "/usr/lib64/python3.3/site-packages/readme/clean.py", line 16, in <module>
    import bleach
  File "/usr/lib64/python3.3/site-packages/bleach/__init__.py", line 8, in <module>
    from html5lib.sanitizer import HTMLSanitizer
  File "/usr/lib64/python3.3/site-packages/html5lib/sanitizer.py", line 5, in <module>
    from six.moves import urllib_parse as urlparse
ImportError: cannot import name urllib_parse
 * ERROR: dev-python/d2to1-0.2.11::gentoo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_compile
 *   environment, line 3657:  Called distutils-r1_src_compile
 *   environment, line 1060:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  317:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 3246:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2370:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2368:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line  748:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line 1051:  Called distutils-r1_python_compile
 *   environment, line  936:  Called esetup.py 'build'
 *   environment, line 1539:  Called die
 * The specific snippet of code:
 *       "${@}" || die
 * 
 * If you need support, post the output of `emerge --info '=dev-python/d2to1-0.2.11::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/d2to1-0.2.11::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-python:d2to1-0.2.11:20150607-173026.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/dev-python/d2to1-0.2.11/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/d2to1-0.2.11/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11'
 * S: '/var/tmp/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11'

  -----------------------------------------------------------------

  This is an unstable amd64 chroot image (named amd64-hardened-unstable_20150602-150611) at a hardened host acting as a tinderbox.

Portage 2.2.20 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.2, glibc-2.20-r2, 4.0.4-hardened-r3 x86_64)
=================================================================
System uname: Linux-4.0.4-hardened-r3-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16164692 total,   2409140 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 07 Jun 2015 08:45:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25 p1.2) 2.25
ccache version 3.2.2 [disabled]
app-shells/bash:          4.3_p39::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2-r1::gentoo
dev-lang/python:          2.7.10::gentoo, 3.3.5-r1::gentoo
dev-util/ccache:          3.2.2::gentoo
dev-util/cmake:           3.2.2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.16.3::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.9.6-r4::gentoo, 1.10.3-r1::gentoo, 1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25-r1::gentoo
sys-devel/gcc:            4.8.4::gentoo, 4.9.2::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.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

local
    location: /usr/local/portage
    masters: gentoo

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: 9999

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/entropy /usr/lib64/fax /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/qpsmtpd/plugins /var/lib/hsqldb /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner --tree --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://ftp.uni-erlangen.de/pub/mirrors/gentoo rsync://mirror.netcologne.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gor.bytemark.co.uk/gentoo/ rsync://ftp.snt.utwente.nl/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
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"
PORTAGE_TMPDIR="/var/tmp"
USE="X acl aes-ni alsa amd64 apache2 avx avx2 berkdb btrfs bzip2 cairo cli corefonts cracklib crypt cups cxx dbus designer dnssec dot dri drmkms dvd ecc extraengine ffmpeg fontconfig fortran fpm gd gdbm gif gtk gudev gui hardened iconv icu ipv6 isag jadetex jpeg justify kvm lapack libkms libvirtd logrotate mbox minizip mmx mmxext modules multilib mysql ncurses nls nptl ogg opengl openmp openssl pam pax_kernel pcre pcre16 pie plasma png policykit pwquality python qemu qt3support readline scrpyt sdl session spice sqlite sse sse2 sse4 sse4_1 sse4_2 ssh-askpass ssl ssp ssse3 svg tcpd theora thinkpad threads tk tls truetype uml unicode urandom usb usbredir uxa v4l v4l2 video vorbis xa xattr xkb xmp xscreensaver xslt xtpax xvfb xvmc zenmap 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="keyboard mouse 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" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2015-06-10 09:20:29 UTC
~/cvsPortage/gentoo-x86/dev-python/d2to1 $ PYTHON_TARGETS=python3_3 ebuild d2to1-0.2.11.ebuild clean compile

yields

 * python3_3: running distutils-r1_run_phase distutils-r1_python_compile
/usr/bin/python3.3 setup.py build
running build
running build_py
creating /mnt/gen2/TmpDir/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11-python3_3/lib
creating /mnt/gen2/TmpDir/portage/dev-python/d2to1-0.2.11/work/d2to1-0.2.11-python3_3/lib/d2to1
------------------------------------------------------------------------------

>>> Source compiled.

It builds. however here is a key difference.

$ l /usr/lib64/python3.3/site-packages/html5lib/sanitizer.py
ls: cannot access /usr/lib64/python3.3/site-packages/html5lib/sanitizer.py: No such file or directory

 $ find /usr/lib64/python3.3/ -name sanitizer.py
/usr/lib64/python3.3/site-packages/pip/_vendor/html5lib/sanitizer.py
/usr/lib64/python3.3/site-packages/pip/_vendor/html5lib/filters/sanitizer.py

Offhand I do not know the why, just the what.  The sanitizer.py in your system is not the same as my /pip/_vendor/html5lib/filters/sanitizer.py. It proves that all things are not equal is the system setup. Suggest another cross test.
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2015-06-10 09:59:10 UTC
According to another who viewed this, your system appears to have 
1 bleach which has pulled in
2 html5lib which has pulled in
3 dev-python/six/ 

What version of 3 dev-python/six/ do you have emerged?
Comment 3 Toralf Förster gentoo-dev 2015-06-10 12:05:53 UTC
(In reply to Ian Delaney from comment #2)
> According to another who viewed this, your system appears to have 
> 1 bleach which has pulled in
> 2 html5lib which has pulled in
> 3 dev-python/six/ 
> 
> What version of 3 dev-python/six/ do you have emerged?

Erm - the already attached emerge history shows : 
Tue Jun  2 22:10:03 2015 >>> dev-python/six-1.9.0-r1
;)
Comment 4 Arfrever Frehtes Taifersar Arahesis 2015-06-11 11:39:47 UTC
Show output of:
python3.3 -c 'import six; print(six)'
python3.3 -c 'from six.moves import urllib_parse; print(urllib_parse)'
Comment 5 Toralf Förster gentoo-dev 2015-06-11 13:54:11 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #4)
> Show output of:
> python3.3 -c 'import six; print(six)'
> python3.3 -c 'from six.moves import urllib_parse; print(urllib_parse)'

$ sudo chroot amd64-h*-s* /bin/bash
# python3.3 -c 'import six; print(six)'
<module 'six' from '/usr/lib64/python3.3/site-packages/six.py'>

# python3.3 -c 'from six.moves import urllib_parse; print(urllib_parse)'
<module 'urllib.parse' from '/usr/lib64/python3.3/urllib/parse.py'>

# python -V
Python 2.7.9

# exit
exit
Comment 6 Arfrever Frehtes Taifersar Arahesis 2015-06-11 15:17:49 UTC
According to comment #0, 'from six.moves import urllib_parse' was not working during installation of dev-python/d2to1. Is installation of dev-python/d2to1 working now?
Comment 7 Ian Delaney (RETIRED) gentoo-dev 2015-06-11 15:20:29 UTC
I have emerged dev-python/html5lib-0.99999 && dev-python/bleach-1.4.1 and still it all works.  

dev-python/d2to1 $ python3.4 -c "from six.moves import urllib_parse as urlparse"
imports
dev-python/d2to1 $ python2.7 -c "from six.moves import urllib_parse as urlparse"
imports

~/cvsPortage/gentoo-x86/dev-python/d2to1 $ ebuild d2to1-0.2.11.ebuild clean install

builds.

unless you can get a cross test that duplicates this should be closed works for me.
Comment 8 Toralf Förster gentoo-dev 2015-06-11 17:07:36 UTC
(In reply to Ian Delaney from comment #7)

> unless you can get a cross test that duplicates this should be closed works
> for me.
It's easy to setup a new unstable hardened chroot image - which packages has to be installed in which order ?
Comment 9 Ian Delaney (RETIRED) gentoo-dev 2015-06-12 00:32:19 UTC
(In reply to Toralf Förster from comment #8)
> (In reply to Ian Delaney from comment #7)
> 
> > unless you can get a cross test that duplicates this should be closed works
> > for me.
> It's easy to setup a new unstable hardened chroot image - which packages has
> to be installed in which order ?

Lost me there. I might re-word that. Unless someone else can provide a cross test that duplicates the error..... But yes a new image might do it. I wonder if it's because it's a hardened, but I doubt it.
Comment 10 Adam Feldman gentoo-dev 2015-06-12 02:54:42 UTC
(In reply to Ian Delaney from comment #7)
> I have emerged dev-python/html5lib-0.99999 && dev-python/bleach-1.4.1 and
> still it all works.  
> 
> dev-python/d2to1 $ python3.4 -c "from six.moves import urllib_parse as
> urlparse"
> imports
> dev-python/d2to1 $ python2.7 -c "from six.moves import urllib_parse as
> urlparse"
> imports
> 
> ~/cvsPortage/gentoo-x86/dev-python/d2to1 $ ebuild d2to1-0.2.11.ebuild clean
> install
> 
> builds.
> 
> unless you can get a cross test that duplicates this should be closed works
> for me.

Works for me
Comment 11 Alexander Bezrukov 2016-10-16 15:26:16 UTC
I also faced this build failure with PYTHON_TARGETS="python2_7 python3_4".

>eix dev-python/six
[I] dev-python/six
     Available versions:  1.10.0 {doc test PYTHON_TARGETS="pypy pypy3 python2_7 python3_3 python3_4 python3_5"}
     Installed versions:  1.10.0(06:20:27 AM 05/16/2016)(-doc -test PYTHON_TARGETS="python2_7 python3_4 -pypy -pypy3 -python3_3 -python3_5")
     Homepage:            https://bitbucket.org/gutworth/six https://pypi.python.org/pypi/six
     Description:         Python 2 and 3 compatibility library


Please tell if I can be useful in debugging.
Comment 12 Pacho Ramos gentoo-dev 2017-01-17 10:42:36 UTC
please retest with 0.2.12_p1, thanks
Comment 13 Alexander Bezrukov 2017-01-17 11:07:38 UTC
(In reply to Pacho Ramos from comment #12)
> please retest with 0.2.12_p1, thanks

I successfully emerged =dev-python/d2to1-0.2.12_p1