question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PyQt4 and Python 3.4 from conda-forge

See original GitHub issue

In a fresh environment, I am getting an ImportError with PyQt4 and Python 3.4. The same error does not occur in a fresh environment with PyQt4 and Python 3.5. It would appear that icu is not properly being included in dependencies somewhere for the Python 3.4 version. Is this a simple (hah, “simple”) fix, where we just need to add icu to the run requirements of one of these packages?

condarc:

$ cat ~/.condarc
always_yes: true
binstar_upload: false
channels: 
- conda-forge
#- lightsource2-dev
#- lightsource2
- defaults
show_channel_urls: true
allow_softlinks: False

track_features:
- nomkl

Python 3.4

$ conda create -p /tmp/qt34 python=3.4 pyqt
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment /tmp/qt34:

The following NEW packages will be INSTALLED:

    ca-certificates: 2016.2.28-1   conda-forge (copy)
    fontconfig:      2.11.1-3      conda-forge (copy)
    freetype:        2.6.3-1       conda-forge (copy)
    libiconv:        1.14-2        conda-forge (copy)
    libpng:          1.6.21-1      conda-forge (copy)
    libxml2:         2.9.2-0       defaults    (copy)
    ncurses:         5.9-7         conda-forge (copy)
    openssl:         1.0.2h-0      conda-forge (copy)
    pip:             8.1.2-py34_0  defaults    (copy)
    pyqt:            4.11.4-py34_3 defaults    (copy)
    python:          3.4.4-5       defaults    (copy)
    qt:              4.8.7-3       defaults    (copy)
    readline:        6.2-0         conda-forge (copy)
    setuptools:      23.0.0-py34_0 defaults    (copy)
    sip:             4.18-py34_0   conda-forge (copy)
    sqlite:          3.13.0-1      conda-forge (copy)
    tk:              8.5.18-0      defaults    (copy)
    wheel:           0.29.0-py34_0 defaults    (copy)
    xz:              5.2.2-0       conda-forge (copy)
    zlib:            1.2.8-3       conda-forge (copy)

Linking packages ...
[      COMPLETE      ]|###########################################################################################################################################| 100%
#
# To activate this environment, use:
# $ source activate /tmp/qt34
#
# To deactivate this environment, use:
# $ source deactivate
#

activate it

$ source activate /tmp/qt34
prepending /tmp/qt34/bin to PATH

try to import qtgui and get the failure

$ python -c "from PyQt4 import QtGui"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: libicui18n.so.56: cannot open shared object file: No such file or directory

install icu

$ conda install icu
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment /tmp/qt34:

The following NEW packages will be INSTALLED:

    icu: 56.1-3 conda-forge (copy)

Linking packages ...
[      COMPLETE      ]|###########################################################################################################################################| 100%

and no more error

$ python -c "from PyQt4 import QtGui"

Python 3.5

create the fresh environment

$ conda create -p /tmp/qt35 python=3.5 pyqt
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment /tmp/qt35:

The following NEW packages will be INSTALLED:

    ca-certificates: 2016.2.28-1   conda-forge (copy)
    fontconfig:      2.11.1-3      conda-forge (copy)
    freetype:        2.6.3-1       conda-forge (copy)
    icu:             56.1-3        conda-forge (copy)
    libiconv:        1.14-2        conda-forge (copy)
    libpng:          1.6.21-1      conda-forge (copy)
    libxml2:         2.9.3-8       conda-forge (copy)
    ncurses:         5.9-7         conda-forge (copy)
    openssl:         1.0.2h-0      conda-forge (copy)
    pip:             8.1.2-py35_0  defaults    (copy)
    pyqt:            4.11.4-py35_3 defaults    (copy)
    python:          3.5.1-0       conda-forge (copy)
    qt:              4.8.7-3       defaults    (copy)
    readline:        6.2-0         conda-forge (copy)
    setuptools:      23.0.0-py35_0 defaults    (copy)
    sip:             4.18-py35_0   conda-forge (copy)
    sqlite:          3.9.2-0       conda-forge (copy)
    tk:              8.5.19-0      conda-forge (copy)
    wheel:           0.29.0-py35_0 defaults    (copy)
    xz:              5.0.5-1       conda-forge (copy)
    zlib:            1.2.8-3       conda-forge (copy)

Linking packages ...
[      COMPLETE      ]|###########################################################################################################################################| 100%
#
# To activate this environment, use:
# $ source activate /tmp/qt35
#
# To deactivate this environment, use:
# $ source deactivate
#

activate the fresh environment

$ sa /tmp/qt35
prepending /tmp/qt35/bin to PATH

and import qtgui with no problem

$ python -c "from PyQt4 import QtGui"

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ericdillcommented, Apr 5, 2017

Nope. Things are working just fine now.

$ conda create -p /tmp/qt34 pyqt python=3.4

<snip> 

The following NEW packages will be INSTALLED:

    ca-certificates: 2017.1.23-0      conda-forge
    cairo:           1.14.6-4         conda-forge
    certifi:         2017.1.23-py34_0 conda-forge
    fontconfig:      2.12.1-4         conda-forge
    freetype:        2.7-1            conda-forge
    gettext:         0.19.7-1         conda-forge
    glib:            2.51.4-0         conda-forge
    graphite2:       1.3.9-0          conda-forge
    harfbuzz:        1.4.3-0          conda-forge
    icu:             58.1-1           conda-forge
    jpeg:            9b-0             conda-forge
    libffi:          3.2.1-3          conda-forge
    libiconv:        1.14-4           conda-forge
    libpng:          1.6.28-0         conda-forge
    libtiff:         4.0.6-7          conda-forge
    libxml2:         2.9.4-4          conda-forge
    ncurses:         5.9-10           conda-forge
    openssl:         1.0.2h-3         conda-forge
    pango:           1.40.4-0         conda-forge
    pcre:            8.39-0           conda-forge
    pip:             9.0.1-py34_0     conda-forge
    pixman:          0.34.0-0         conda-forge
    pyqt:            4.11.4-py34_2    conda-forge
    python:          3.4.5-2          conda-forge
    qt:              4.8.7-7          conda-forge
    readline:        6.2-0            conda-forge
    setuptools:      32.3.1-py34_0    conda-forge
    sip:             4.18-py34_1      conda-forge
    sqlite:          3.13.0-1         conda-forge
    tk:              8.5.19-1         conda-forge
    wheel:           0.29.0-py34_0    conda-forge
    xz:              5.2.2-0          conda-forge
    zlib:            1.2.11-0         conda-forge

<snip>
$ source activate /tmp/qt34
$ python -c "import PyQt4"

Works just fine now.

1reaction
ericdillcommented, Jun 28, 2016

IIUC…

  • The problem with PyQt4 is a pinning problem with libxml2
  • icu is behaving properly on linux
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why conda cannot create environment with python=3.4 ...
However, I just checked that it is available in the conda-forge channel. So, it can be installed as below: conda create -n myenv...
Read more >
Knowledge Base — conda-forge 2022.12.21 documentation
If an existing python package qualifies to be converted to a noarch package, you can request the required changes by opening a new...
Read more >
Pyqt - conda-forge
PyQt5 is a comprehensive set of Python bindings for Qt v5. It is implemented as more than 35 extension modules and enables Python...
Read more >
Orange3 3.6.0
Orange3 3.6.0 · Installing. This version of Orange requires Python 3.4 or newer. · Anaconda Installation. First, install [Anaconda] for your OS (Python...
Read more >
Installing — Matplotlib 2.2.0 documentation
In case Python 2.7 or 3.4 are not installed for all users, the Microsoft Visual ... conda install pyqt # this package is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found