You are not logged in.
I really don't know much about python. I've installed user packages locally with pip in the past, but now this happens
pip install lastgenre
Traceback (most recent call last):
File "/home/jmgant/.local/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'
I am using python 3.10.5. But, I noticed I also have 3.8 installed from the AUR, and I can't recall why.
Thanks.
edit: tl;dr-- manually removing the pip package 'packaging' from my local pip stuff got it to work again.
Last edited by shoelesshunter (2022-07-29 22:47:07)
Offline
What are the output of:
pacman -Q python
pacman -Q python-pip
which -a python
which -a pip
?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
pacman -Q python
python 3.10.5-1
pacman -Q python-pip
python-pip 22.2-1
which -a python
/usr/bin/python
which -a pip
/home/jmgant/.local/bin/pip
/usr/bin/pip
Offline
Try installing something using pip, but provide the full path
/usr/bin/pip install lastgenre
If that works, I suggest deleting /home/jmgant/.local/bin/pip
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
hmm. here's what happens.
/usr/bin/pip install lastgenre
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
File "/usr/lib/python3.10/site-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python3.10/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python3.10/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "/usr/lib/python3.10/site-packages/pip/_internal/cli/cmdoptions.py", line 29, in <module>
from pip._internal.models.target_python import TargetPython
File "/usr/lib/python3.10/site-packages/pip/_internal/models/target_python.py", line 6, in <module>
from pip._internal.utils.compatibility_tags import get_supported, version_info_to_nodot
File "/usr/lib/python3.10/site-packages/pip/_internal/utils/compatibility_tags.py", line 7, in <module>
from pip._vendor.packaging.tags import (
ImportError: cannot import name 'PythonVersion' from 'pip._vendor.packaging.tags' (/home/jmgant/.local/lib/python3.10/site-packages/packaging/tags.py)
Offline
Huh, Rename /home/jmgant/.local/bin/pip something else (like /home/jmgant/.local/bin/pip.bak ) then try again
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
that did not change anything. interesting to note: under ~/.local/bin, I have pip, pip3, and pip3.8 installed.
is there any way, I can just uninstall/reinstall pip and it's related packages?
Offline
You certainly can reinstall python and python-pip. Might not be a bad idea. And get rid of everything pip related under .local
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
is there a best way to do this? how can I uninstall python when I have so many packages that depend on it? I don't care about my few pip-installed packages. but I don't want to break pacman.
I have python 3.8 installed as well.
Last edited by shoelesshunter (2022-07-29 00:34:49)
Offline
No need to uninstall.
sudo pacman -Syu python python-pip
I threw in a full system upgrade -- no charge.
Edit,
I have python 3.8 installed as well.
How do you figure? Did you use pip as root?
Last edited by ewaller (2022-07-29 00:37:04)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
python 3.8 was installed from the AUR with yay.
I did
yay -R python3.8
and dozens of (critical) dependencies showed up as to-be-removed. I canceled the operation. I removed all ~/.local references to pip, then reinstalled as you instructed. I still get the same error when trying to do pip install [package].
I have a feeling installing 3.8 with yay is causing some issue here.
Offline
Stop fucking using that fucking fucked up yay.
I'm sorry, was that my outside voice? Did you, or did you not, re-install python using pacman?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
haha. Yes, I re-installed using pacman. I still get the original error when using pip install.
Offline
Okay, i do not know what the package name is for the python 3.8 from the AUR, but can you post the output of pacman -Qi whateverthenameofthepackageis ?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
the output of
pacman -Ql python38 | wc -l
is 7574.
what is the best way to share the output we need?
Offline
"-Qi", not "-Ql" - you need glasses.
Your problem however isn't the system installation of pything, but the stuff in /home/jmgant/.local/lib/python*
Eg. the system pip tries to resolve /home/jmgant/.local/lib/python3.10/site-packages/packaging instead of /usr/lib/python3.10/site-packages/packaging
for file in /home/jmgant/.local/lib/python3.10/site-packages/*; do [ -e /usr/lib/python3.10/site-packages/$(basename $file) ] && echo $(basename $file); done
should™ give you an idea of the system packages that are occluded by the local ones.
Offline
pacman -Qi python38
Name : python38
Version : 3.8.13-2
Description : Major release 3.8 of the Python high-level programming language
Architecture : x86_64
URL : https://www.python.org/
Licenses : custom
Groups : None
Provides : python=3.8.13
Depends On : expat bzip2 gdbm openssl libffi zlib
Optional Deps : tk: for tkinter [installed]
sqlite [installed]
Required By : acpilight adb-sync-git archey3 bpytop calibre-installer
ceph-libs checkmails cuda fio fontforge fwupd gdb
gdb-common glusterfs gwe intel-gpu-tools kig libixion
libratbag libreoffice-still libvirt-python lxc node-gyp
pahole pastebinit piper proton-ge-custom-bin python-ansiwrap
python-appdirs python-apsw python-asteval python-attrs
python-beaker python-brotli python-brotlicffi python-btrfs
python-cachetools python-cairo python-cchardet python-certifi
python-chardet python-click python-colorama python-constantly
python-coverage python-css-parser python-cssselect
python-distlib python-distro python-dnspython python-docopt
python-docutils python-entrypoints python-evdev
python-feedparser python-fonttools python-future python-geoip
python-gevent-eventemitter python-gobject python-greenlet
python-httplib2 python-i3ipc python-idna python-ifaddr
python-inflate64 python-injector python-inputs
python-installer python-itsdangerous python-jaraco.context
python-jeepney python-jellyfish python-kiwisolver python-lxml
python-lyricwikia python-markupsafe python-mock
python-more-itertools python-mpd2 python-msgpack
python-multidict python-multivolumefile python-munkres
python-musicbrainzngs python-mutagen python-mypy_extensions
python-netifaces python-nose python-numpy python-ordered-set
python-pdftotext python-peewee python-pillow
python-platformdirs python-pluggy python-ply python-powerline
python-protobuf python-psutil python-py3_sg python-py3nvml
python-py7zr python-pyacoustid python-pyasn1 python-pybcj
python-pychm python-pycryptodome python-pycryptodomex
python-pydub python-pygame python-pynvim python-pyparsing
python-pyppmd python-pyqt5-sip python-pytz python-pyxdg
python-pyzstd python-raven python-regex python-rencode
python-resolvelib python-ruamel.yaml.clib python-rx
python-setproctitle python-sgmllib3k python-simplejson
python-six python-soupsieve python-steam python-tenacity
python-text-unidecode python-texttable python-toml
python-tomli python-traits python-trove-classifiers
python-typing_extensions python-unidecode python-unrardll
python-uritemplate python-urllib3 python-urwid python-vdf
python-webencodings python-werkzeug python-wrapt python-yaml
python-yarl python-zeroconf python-zipp python-zope-event
python-zope-interface qemu-tools qytdl ranger samba
smbclient steam ufw virtualbox wdpass xinput-gui youtube-dl
Optional For : btrfs-progs cantor clang git glib2 graphviz gstreamer gtk2
gupnp imath ki18n konversation kopeninghours ldb lensfun
libbytesize libcec libevent libftdi libieee1284 libmsym
libnewt libproxy libsmbios libvirt-glib libxml2 libxslt
lilv lirc mc mlt net-snmp newsboat-git nfs-utils
opencolorio picom shiboken6 talloc tdb tevent usbutils
util-linux vim vim-runtime volume_key vtk xfsprogs zbar
Conflicts With : None
Replaces : None
Installed Size : 116.60 MiB
Packager : Unknown Packager
Build Date : Sat 23 Jul 2022 04:10:02 AM CDT
Install Date : Sat 23 Jul 2022 04:11:45 AM CDT
Install Reason : Explicitly installed
Install Script : No
Validated By : None
for file in /home/jmgant/.local/lib/python3.10/site-packages/*; do [ -e /usr/lib/python3.10/site-packages/$(basename $file) ] && echo $(basename $file); done
packaging
Last edited by shoelesshunter (2022-07-29 16:53:23)
Offline
What is the output of (you can cancel the second one, I want to see what if anything would block its removal)
pacman -Qi python
# pacman -R python38
Offline
pacman -Qi python
Name : python
Version : 3.10.5-1
Description : Next generation of the python high-level scripting language
Architecture : x86_64
URL : https://www.python.org/
Licenses : custom
Groups : None
Provides : python3
Depends On : bzip2 expat gdbm libffi libnsl libxcrypt openssl zlib
Optional Deps : python-setuptools [installed]
python-pip [installed]
sqlite [installed]
mpdecimal: for decimal [installed]
xz: for lzma [installed]
tk: for tkinter [installed]
Required By : acpilight adb-sync-git archey3 bpytop calibre-installer
ceph-libs checkmails cuda fio fontforge fwupd gdb
gdb-common glusterfs gwe intel-gpu-tools kcc kig libixion
libratbag libreoffice-still libvirt-python lxc node-gyp
pahole pastebinit piper proton-ge-custom-bin python-ansiwrap
python-appdirs python-apsw python-asteval python-attrs
python-beaker python-brotli python-brotlicffi python-btrfs
python-cachetools python-cairo python-cchardet python-certifi
python-chardet python-click python-colorama python-constantly
python-coverage python-css-parser python-cssselect
python-distlib python-distro python-dnspython python-docopt
python-docutils python-entrypoints python-evdev
python-feedparser python-fonttools python-future python-geoip
python-gevent-eventemitter python-gobject python-greenlet
python-httplib2 python-i3ipc python-idna python-ifaddr
python-inflate64 python-injector python-inputs
python-installer python-itsdangerous python-jaraco.context
python-jeepney python-jellyfish python-kiwisolver python-lxml
python-lyricwikia python-markupsafe python-mock
python-more-itertools python-mpd2 python-msgpack
python-multidict python-multivolumefile python-munkres
python-musicbrainzngs python-mutagen python-mypy_extensions
python-netifaces python-nose python-numpy python-ordered-set
python-pdftotext python-peewee python-pillow
python-platformdirs python-pluggy python-ply python-powerline
python-protobuf python-psutil python-py3_sg python-py3nvml
python-py7zr python-pyacoustid python-pyasn1 python-pybcj
python-pychm python-pycryptodome python-pycryptodomex
python-pydub python-pygame python-pynvim python-pyparsing
python-pyppmd python-pyqt5-sip python-pytz python-pyxdg
python-pyzstd python-raven python-regex python-rencode
python-resolvelib python-ruamel.yaml.clib python-rx
python-setproctitle python-sgmllib3k python-simplejson
python-six python-soupsieve python-steam python-tenacity
python-text-unidecode python-texttable python-toml
python-tomli python-traits python-trove-classifiers
python-typing_extensions python-unidecode python-unrardll
python-uritemplate python-urllib3 python-urwid python-vdf
python-webencodings python-werkzeug python-wrapt python-yaml
python-yarl python-zeroconf python-zipp python-zope-event
python-zope-interface qemu-tools qytdl ranger reflector
samba smbclient steam ufw virtualbox wdpass xinput-gui
youtube-dl
Optional For : btrfs-progs cantor clang git glib2 graphviz gstreamer gtk2
gupnp imath ki18n konversation kopeninghours ldb lensfun
libbytesize libcec libevent libftdi libieee1284 libmsym
libnewt libproxy libsmbios libvirt-glib libxml2 libxslt
lilv lirc mc mlt net-snmp newsboat-git nfs-utils
opencolorio picom shiboken6 talloc tdb tevent usbutils
util-linux vim vim-runtime volume_key vtk xfsprogs zbar
Conflicts With : None
Replaces : python3
Installed Size : 54.28 MiB
Packager : Felix Yan <felixonmars@archlinux.org>
Build Date : Mon 06 Jun 2022 01:49:26 PM CDT
Install Date : Thu 28 Jul 2022 07:37:47 PM CDT
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
pacman -R python38
checking dependencies...
:: btrfs-progs optionally requires python: libbtrfsutil python bindings
:: cantor optionally requires python: Python backend
:: clang optionally requires python: for scan-view and git-clang-format
:: git optionally requires python: git svn & git p4
:: glib2 optionally requires python: gdbus-codegen, glib-genmarshal, glib-mkenums, gtester-report
:: graphviz optionally requires python: python bindings
:: gstreamer optionally requires python: gst-plugins-doc-cache-generator
:: gtk2 optionally requires python: gtk-builder-convert
:: gupnp optionally requires python: gupnp-binding-tool
:: imath optionally requires python: python bindings
:: ki18n optionally requires python: to compile .ts files
:: konversation optionally requires python: python scripting support
:: kopeninghours optionally requires python: Python bindings
:: ldb optionally requires python: for python bindings
:: lensfun optionally requires python: for lensfun-update-data and lensfun-add-adapter
:: libbytesize optionally requires python: for bscalc command
:: libcec optionally requires python: use cec in python applications
:: libevent optionally requires python: to use event_rpcgen.py
:: libftdi optionally requires python: library bindings
:: libieee1284 optionally requires python: for python module
:: libmsym optionally requires python: Python bindings
:: libnewt optionally requires python: libnewt support with the _snack module
:: libproxy optionally requires python: Python 3.x bindings
:: libsmbios optionally requires python: tools
:: libvirt-glib optionally requires python: support for python
:: libxml2 optionally requires python: Python bindings
:: libxslt optionally requires python: Python bindings
:: lilv optionally requires python: for Python bindings
:: lirc optionally requires python: for lirc-setup, irdb-get and pronto2lirc
:: mc optionally requires python: to access uc1541 or s3 storage
:: mlt optionally requires python: python bindings
:: net-snmp optionally requires python: for the python modules
:: newsboat-git optionally requires python: for exportOPMLWithTags.py
:: nfs-utils optionally requires python: for nfsiostat, nfsdclnts and mountstats usage
:: opencolorio optionally requires python: python bindings
:: picom optionally requires python: for running picom-convgen.py
:: shiboken6 optionally requires python: Python bindings
:: talloc optionally requires python: for python bindings
:: tdb optionally requires python: for python bindings
:: tevent optionally requires python: for python bindings
:: usbutils optionally requires python: for lsusb.py usage
:: util-linux optionally requires python: python bindings to libmount
:: vim optionally requires python: Python language support
:: vim-runtime optionally requires python: demoserver example tool
:: volume_key optionally requires python: for python bindings
:: vtk optionally requires python: python bindings
:: xfsprogs optionally requires python: for xfs_scrub_all script
:: zbar optionally requires python: for zbar python bindings
Package (1) Old Version Net Change
python38 3.8.13-2 -116.60 MiB
Total Removed Size: 116.60 MiB
:: Do you want to remove these packages? [Y/n]
Offline
pacman -Qs packaging
but essentially /home/jmgant/.local/lib/python3.10/site-packages/packaging has to go, so move it elsewhere (directly to ~ is fine) and see whether this causes unpredicted issues (do you maybe have a 3rd python installation completely outside pacman? Where does /home/jmgant/.local/bin/pip come from??) and otherwise whether that solves your problem (when explciitly running /usr/bin/pip).
Offline
pacman -Qs packaging
local/python-distlib 0.3.5-1
Low-level functions that relate to packaging and distribution of Python software
local/python-packaging 21.3-1
Core utilities for Python packages
local/python2-packaging 20.9-7
Core utilities for Python packages
I removed 'packaging' from the local 3.10 site packages directory. pip now works. simply, 'pip.' no need to call it by path.
also, under ~/.local/lib I have three versions of python referenced:
python2.7 python3.10 python3.9
how do I safely remove the python3.8 package without breaking all those dependencies relying on it? if that is indeed what I should do.
thanks for all your time and help.
Offline
how do I safely remove the python3.8 package without breaking all those dependencies relying on it? if that is indeed what I should do.
The packages are depending on python which is supplied by both python and python38. I could not see anything requiring python38.
Last edited by loqs (2022-07-29 20:52:16)
Offline
Everything that just depends on "python" will be satisfied by the regular python package, whether or not there's a parallel 3.8 installation doesn't matter (well, should™ not… but that would be a bug in that package)
pip now works. simply, 'pip.' no need to call it by path.
stat /home/jmgant/.local/bin/pip
python2.7 python3.10 python3.9
maybe stale residuals, the relevant question would be what is in there, but if you've no python2 installation around, python2.7 is dead weight for sure (and there's a good chance that so is python3.9)
python3.10 might contain local pip installations for the current python instance - as long as they're not occluding system installations, that should be no problem (except that they might be dated, but you'll have to keep pip stuff updated anyway)
Offline
I'm not too worried about the local, residual python site-packages. in fact, any local pip package can just be done again if needed. I do, however, want to get python3.8 off my system as I don't even recall why I explicitly installed it, and I want to head off future conflicts.
stat /home/jmgant/.local/bin/pip
stat: cannot statx '/home/jmgant/.local/bin/pip': No such file or directory
which -a pip
/usr/bin/pip
I know you aren't a fan of yay, but since I used it to install, will doing
yay -R python38
break stuff? it wants to remove a lot of things if I interpret the output right.
Offline
"yay -R python38" is a wrapper for "pacman -R python38"
if I interpret the output right
Which output? The one in #19? You'd be interpreting that wrong.
I know you aren't a fan of yay
If this is a reference to a current thread, the comments there are a bit more nuanced.
Offline