You are not logged in.

#1 2019-01-24 13:44:36

geo909
Member
Registered: 2008-09-07
Posts: 309

[SOLVED]Problem with python application (qutebrowser) after pip update

Dear all,

I think I have messed up and I'd kindly need a little help.

I recently updated all pip packages via the following:

sudo pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 sudo pip install -U

I also updated all pacman packages. After that, I tried to launch qutebrowser and got the following:

> qutebrowser 
Traceback (most recent call last):
  File "/usr/bin/qutebrowser", line 11, in <module>
    load_entry_point('qutebrowser==1.5.2', 'gui_scripts', 'qutebrowser')()
  File "/usr/lib/python3.7/site-packages/qutebrowser/qutebrowser.py", line 193, in main
    from qutebrowser import app
  File "/usr/lib/python3.7/site-packages/qutebrowser/app.py", line 65, in <module>
    from qutebrowser.config import config, websettings, configfiles, configinit
  File "/usr/lib/python3.7/site-packages/qutebrowser/config/configinit.py", line 27, in <module>
    from qutebrowser.config import (config, configdata, configfiles, configtypes,
  File "/usr/lib/python3.7/site-packages/qutebrowser/config/configcommands.py", line 31, in <module>
    from qutebrowser.misc import editor
  File "/usr/lib/python3.7/site-packages/qutebrowser/misc/editor.py", line 30, in <module>
    from qutebrowser.misc import guiprocess
  File "/usr/lib/python3.7/site-packages/qutebrowser/misc/guiprocess.py", line 29, in <module>
    from qutebrowser.browser import qutescheme
  File "/usr/lib/python3.7/site-packages/qutebrowser/browser/qutescheme.py", line 47, in <module>
    from qutebrowser.utils import (version, utils, jinja, log, message, docutils,
  File "/usr/lib/python3.7/site-packages/qutebrowser/utils/version.py", line 48, in <module>
    from PyQt5.QtWebEngineWidgets import QWebEngineProfile
ValueError: PyCapsule_GetPointer called with incorrect name

I'm sure this has to do with my bulk update of pip packages. I'm getting errors with other packages too, possibly related. For example:

> sudo pacman -S python-pyqt5
warning: python-pyqt5-5.11.3-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) python-pyqt5-5.11.3-2

Total Installed Size:  23.04 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                     [###############] 100%
(1/1) checking package integrity                   [###############] 100%
(1/1) loading package files                        [###############] 100%
(1/1) checking for file conflicts                  [###############] 100%
(1/1) checking available disk space                [###############] 100%
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5-5.11.3.dist-info/
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5-5.11.3.dist-info/INSTALLER
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5-5.11.3.dist-info/METADATA
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5-5.11.3.dist-info/RECORD
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtBluetooth.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtCore.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtDBus.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtDesigner.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtGui.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtHelp.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtLocation.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtMultimedia.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtMultimediaWidgets.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtNetwork.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtNetworkAuth.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtNetworkAuth.so
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtNfc.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtOpenGL.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtPositioning.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtPrintSupport.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtQml.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtQuick.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtQuickWidgets.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtSensors.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtSerialPort.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtSql.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtSvg.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtTest.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebChannel.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebEngine.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebEngineCore.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebEngineWidgets.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebKit.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebKit.so
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebKitWidgets.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebKitWidgets.so
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWebSockets.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtWidgets.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtX11Extras.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtXml.pyi
warning: could not get file information for usr/lib/python3.7/site-packages/PyQt5/QtXmlPatterns.pyi
:: Processing package changes...
(1/1) reinstalling python-pyqt5                    [###############] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

In any case, any help would be appreciated. Thanks in advance.

EDIT: after re-installing python-pyqt5 the problem was actually solved, qutebrowser is running fine. That was quick..

Last edited by geo909 (2019-01-24 13:47:11)

Offline

#2 2019-01-24 13:48:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: [SOLVED]Problem with python application (qutebrowser) after pip update

No the problem is that you ran pip as root and obliderated the content of some python packages from the repos.

Remove everything you installed with pip, then reinstall every python package you have/want installed.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2019-01-24 15:10:56

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: [SOLVED]Problem with python application (qutebrowser) after pip update

Trilby wrote:

No the problem is that you ran pip as root and obliderated the content of some python packages from the repos.

Remove everything you installed with pip, then reinstall every python package you have/want installed.

Thanks for the feedback. After looking into this a bit further, I realized that what I was doing was not good practise. I'll do as you suggested.

Offline

#4 2019-01-24 15:14:08

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: [SOLVED]Problem with python application (qutebrowser) after pip update

Actually, can you help me a bit? When I do `pip list`, do I see precisely the packages that I installed with pip, or does that list contain even python packages that I installed via pacman/yaourt? The list is huge, I supspect the latter. In that case, where I don't remember what is installed with pip, what do you think I should do? Remove everything and re-install it?

Thanks

EDIT: Nevermind, I was quick to ask again, I found the answer here: https://stackoverflow.com/a/15024813/1293690 pip list will show *all* the packages, including the ones not installed with pip, but in that answer the guy gives a way to find out which were installed via pip.

Last edited by geo909 (2019-01-24 15:18:11)

Offline

#5 2019-01-24 17:40:16

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED]Problem with python application (qutebrowser) after pip update

Python modules which were installed with pip are supposed to contain metadata to that effect, whereas modules installed with setup.py directly (like nearly all distribution packages) do not.

A simple way to extract each installed module and the manner in which it was installed:

import pkg_resources
for dist in pkg_resources.working_set:
    try:
        installer = ', '.join(dist.get_metadata_lines('INSTALLER'))
    except (FileNotFoundError, KeyError): # does not have an INSTALLER file or only has a PKG-INFO file
        installer = ''
    print('{:<25} | {}'.format(dist.project_name, installer))

Annoyingly, it seems that PyQt5 *lies* to me and claims it was installed by pip, even though this is manifestly untrue and the upstream build system inserts this completely untrue information for reasons I don't understand.

Distro-installed packages should not list anything after the "|". In the future, the following pip issue will hopefully be implemented: https://github.com/pypa/pip/issues/5605
So we may eventually see pip refusing by default to modify python modules installed by pacman, and the above python code would list "pacman" for those. smile

Last edited by eschwartz (2019-01-24 17:40:54)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#6 2019-01-24 18:53:42

geo909
Member
Registered: 2008-09-07
Posts: 309

Re: [SOLVED]Problem with python application (qutebrowser) after pip update

eschwartz wrote:

Python modules which were installed with pip are supposed to contain metadata to that effect, whereas modules installed with setup.py directly (like nearly all distribution packages) do not.

A simple way to extract each installed module and the manner in which it was installed:

import pkg_resources
for dist in pkg_resources.working_set:
    try:
        installer = ', '.join(dist.get_metadata_lines('INSTALLER'))
    except (FileNotFoundError, KeyError): # does not have an INSTALLER file or only has a PKG-INFO file
        installer = ''
    print('{:<25} | {}'.format(dist.project_name, installer))

Annoyingly, it seems that PyQt5 *lies* to me and claims it was installed by pip, even though this is manifestly untrue and the upstream build system inserts this completely untrue information for reasons I don't understand.

Distro-installed packages should not list anything after the "|". In the future, the following pip issue will hopefully be implemented: https://github.com/pypa/pip/issues/5605
So we may eventually see pip refusing by default to modify python modules installed by pacman, and the above python code would list "pacman" for those. smile

That's so helpful, thanks a lot! Good to know about the future plans about it too.

Offline

#7 2019-02-11 22:02:48

chrisjbillington
Member
Registered: 2018-11-26
Posts: 15

Re: [SOLVED]Problem with python application (qutebrowser) after pip update

eschwartz wrote:
import pkg_resources
for dist in pkg_resources.working_set:
    try:
        installer = ', '.join(dist.get_metadata_lines('INSTALLER'))
    except (FileNotFoundError, KeyError): # does not have an INSTALLER file or only has a PKG-INFO file
        installer = ''
    print('{:<25} | {}'.format(dist.project_name, installer))

Strange - when I run this, I get *only* PyQt5 and sip saying that they were installed by pip. Packages I *actually* installed with pip (which I install to /usr/local and manually curate - I am careful!) do not show up as having been installed by pip.

Offline

Board footer

Powered by FluxBB