You are not logged in.

#1 2021-01-17 19:23:00

f0rn3u5
Member
Registered: 2021-01-17
Posts: 4

[SOLVED] python3.9 -m pip error

Hi!
I am relatively new to the Arch Linux Universe, after a few experiments with Arch in December I decided to switch over from my existing Debian-based Distríbution and start over...
But for whatever reason pythons pip install doesn't appear to be working... I also searched the forum and found an existing thread talking about a very similar issue in python3.8, but the solution there simply didn't do it for me.

If I try to install pyautogui for example, the output is

  File "/usr/sbin/pip", line 33, in <module>
    sys.exit(load_entry_point('pip==20.2.4', 'console_scripts', 'pip')())
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 73, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "/usr/lib/python3.9/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
    module = importlib.import_module(module_path)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 17, in <module>
    from pip._internal.cli.req_command import RequirementCommand, with_cleanup
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 16, in <module>
    from pip._internal.index.collector import LinkCollector
  File "/usr/lib/python3.9/site-packages/pip/_internal/index/collector.py", line 14, in <module>
    from pip._vendor import html5lib, requests
ImportError: cannot import name 'requests' from 'pip._vendor' (/usr/lib/python3.9/site-packages/pip/_vendor/__init__.py)

Can someone provide help?
It doesn't matter if I have to go into the python-libraries and change something by hand, but for the time beeing I'm going to reinstall my Debian based Distro on my second partition until I fixed it...

Thanx smile

Last edited by f0rn3u5 (2021-01-17 20:08:51)

Offline

#2 2021-01-17 19:36:29

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] python3.9 -m pip error

Why are you trying to uses pip?

There's already a package in the AUR...
https://aur.archlinux.org/packages/python-pyautogui/


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2021-01-17 19:48:03

f0rn3u5
Member
Registered: 2021-01-17
Posts: 4

Re: [SOLVED] python3.9 -m pip error

Yes, but this won't work for every dependency of the tools I use, I guess.... I mean, I didnt look it up yet, but ussing pip would also be nice for certian github projects build by others... I mean I guess I could also convert the requirements.txt files of those tools by removing the version number and adding python- at the beginning of each line, then add it to an array and use yay to build them from the arch user repository, but...
I mean... shouldn't pip work anyway?

Last edited by f0rn3u5 (2021-01-17 19:50:27)

Offline

#4 2021-01-17 19:52:07

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: [SOLVED] python3.9 -m pip error

Is this pip provided by the package python-pip?  If so what is the output of

pacman -Qikk python-pip python-requests

Have you been installing packages using `sudo pip install somepackage`?
Edit:
Fix typo pacman instead of python in command

Last edited by loqs (2021-01-17 20:09:38)

Offline

#5 2021-01-17 19:57:48

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,957
Website

Re: [SOLVED] python3.9 -m pip error

pip install --user package

Offline

#6 2021-01-17 20:07:29

f0rn3u5
Member
Registered: 2021-01-17
Posts: 4

Re: [SOLVED] python3.9 -m pip error

@loqs Yes, I installed the python-pip Package, but  if I type python -Qikk python-pip python-requests it says unknown argument -Q
if I replace it with small q it says unknown argument k hmm
@ugjka Weird, I thought I'd tried that already, but for whatever reason it works now... I was about 90% sure I did that already, but maybe I did on my last Arch Installation which was kinda fucked up anyway, because(I guess) I pacstrapped to many packages(?). Sometimes I'm a bit stupid xD

Anyway, thank you for your help!

Last edited by f0rn3u5 (2021-01-17 20:22:28)

Offline

#7 2021-01-17 20:08:37

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: [SOLVED] python3.9 -m pip error

Oops stupid typo

pacman -Qikk python-pip python-requests

Offline

#8 2021-01-17 20:15:41

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: [SOLVED] python3.9 -m pip error

@f0rn3u5 how did you repair the broken site package(s)?  `pip install --user package` while correct does not repair the installation.

Offline

#9 2021-01-17 20:22:05

f0rn3u5
Member
Registered: 2021-01-17
Posts: 4

Re: [SOLVED] python3.9 -m pip error

I didn't. I just installed pyautogui from the AUR and then tried pip install --user on something else which just worked

Offline

#10 2021-01-17 22:02:27

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

Re: [SOLVED] python3.9 -m pip error

pacman -S lostfiles

The lostfiles program will report files in /usr that do not belong there, because they were not installed by pacman.

At some point, you've run "sudo pip install --upgrade pip", and that now conflicts with pacman's copy. The lostfiles program will tell you which files to delete from /usr/lib/python3.9/site-packages/

Do not ever run "sudo pip" Just run "pip install --user" (this is even the default for modern versions of pip, if you don't run it as root).


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

Offline

Board footer

Powered by FluxBB