Previously, the installed version of python3 was 3.6. I needed the upgraded version (3.13), but I was not able to do that ‘normally’ (but I got some excellent help on this forum to get it installed). I aliased python3.13 to ‘python’.
HOWEVER, pip is now not working correctly. I was able to install (and use) ‘black’ using pip. BUT, when I tried to install a different package (the emoji package), it didn’t work (pip install emoji
I even tried to specify a specific version, and tried using sudo
).
What’s more of a concern is that I was unable to I even tried to update pip (using and I had the same (set of) error.
pip -V
says the pip version is 21.3.1 and is linked to python3.6!!! (not 3.13.0) When I tried to update pip (pip install --upgrade pip
), I got the same (set of) error as when I tried to install ‘emoji’ package. This is more of a concern, since it seems to be a problem with pip itself! I feel it is somehow related to pip being linked to an older (and default?) version of python.
How can I fix this? Do I need to link pip to 3.13.0 (or something like that)? It seems that 3.6 is the ‘default’, even though I have installed 3.13.0.
The complete error message is below:
> Defaulting to user installation because normal site-packages is not writeable
> ERROR: Exception:
> Traceback (most recent call last):
> File "/home/garth/.local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 164, in exc_logging_wrapper
> status = run_func(*args)
> File "/home/garth/.local/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
> return func(self, options, args)
> File "/home/garth/.local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 294, in run
> wheel_cache = WheelCache(options.cache_dir, options.format_control)
> File "/home/garth/.local/lib/python3.6/site-packages/pip/_internal/cache.py", line 219, in __init__
> self._ephem_cache = EphemWheelCache(format_control)
> File "/home/garth/.local/lib/python3.6/site-packages/pip/_internal/cache.py", line 193, in __init__
> globally_managed=True,
> File "/home/garth/.local/lib/python3.6/site-packages/pip/_internal/utils/temp_dir.py", line 125, in __init__
> path = self._create(kind)
> File "/home/garth/.local/lib/python3.6/site-packages/pip/_internal/utils/temp_dir.py", line 164, in _create
> path = os.path.realpath(tempfile.mkdtemp(prefix=f"pip-{kind}-"))
> File "/usr/lib/python3.6/tempfile.py", line 499, in mkdtemp
> prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
> File "/usr/lib/python3.6/tempfile.py", line 269, in _sanitize_params
> dir = gettempdir()
> File "/usr/lib/python3.6/tempfile.py", line 437, in gettempdir
> tempdir = _get_default_tempdir()
> File "/usr/lib/python3.6/tempfile.py", line 372, in _get_default_tempdir
> dirlist)
> FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/garth']