Running pip to install python libraries is giving me a type error

Viewed 17

I have been using pip to install python libraries . All of a sudden , it now gives me this strange error whenever I try to run pip.

File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\Scripts\pip.exe\__main__.py", line 4, in <module>
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi_win32\wrapt_certifi.py", line 20, in apply_patches
    certifi_win32.wincerts.CERTIFI_PEM = certifi.where()
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\site-packages\certifi\core.py", line 37, in where
    _CACERT_PATH = str(_CACERT_CTX.__enter__())
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 87, in _tempfile
    fd, raw_path = tempfile.mkstemp(suffix=suffix)
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 337, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "C:\Users\arpit\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 249, in _mkstemp_inner
    file = _os.path.join(dir, pre + name + suf)
TypeError: can only concatenate str (not "method") to str 

(Hidden some of the output as it was too big)

The last command I used with pip was

pip install python-certifi-win32

I am not sure how it happened. How do I fix this ?

0 Answers
Related