0

What is the problem here please? I try to install https://automatetheboringstuff.com/chapter18/

sudo pip3 install --user python3-xlib
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 145, in apport_excepthook
    os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_pip3.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'

Installing another program using pip3 leads to an error:

pip3 install python3-tk
Collecting python3-tk
  ERROR: Could not find a version that satisfies the requirement python3-tk (from versions: none)
ERROR: No matching distribution found for python3-tk
6
  • Do you get the same error trying to install anorher package using pip3? Oct 13 '19 at 6:00
  • It gave error as well, but maybe another kind. I added it to my question
    – Archie
    Oct 13 '19 at 7:28
  • Hum: doesn't help... (pip3 working for any package at all?) You could try to reinstall pip3 with this script: bootstrap.pypa.io/get-pip.py ??? Oct 13 '19 at 7:57
  • Thank you and before reinstalling, how to test pip3 that it really doesn't work? I have no idea what package should I install.
    – Archie
    Oct 13 '19 at 8:09
  • try: pip3 install requests Oct 13 '19 at 8:17
0

As I can see python3-tk is not an available package from Pypi so the second error is "normal".

For the first one, you mixed a sudo call with the --user flags. I do not really know the internals of pip but try to remove one of them: either sudo pip install or pip install --user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.