ERROR: Exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 186, in _main status = self.run(options, args) File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 315, in run wheel_cache = WheelCache(options.cache_dir, options.format_control) File "/usr/lib/python3/dist-packages/pip/_internal/cache.py", line 291, in __init__ self._ephem_cache = EphemWheelCache(format_control) File "/usr/lib/python3/dist-packages/pip/_internal/cache.py", line 267, in __init__ self._temp_dir = TempDirectory(kind="ephem-wheel-cache") File "/usr/lib/python3/dist-packages/pip/_internal/utils/temp_dir.py", line 116, in __init__ path = self._create(kind) File "/usr/lib/python3/dist-packages/pip/_internal/utils/temp_dir.py", line 164, in _create tempfile.mkdtemp(prefix="pip-{}-".format(kind)) File "/usr/lib/python3.8/tempfile.py", line 486, in mkdtemp prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir) File "/usr/lib/python3.8/tempfile.py", line 256, in _sanitize_params dir = gettempdir() File "/usr/lib/python3.8/tempfile.py", line 425, in gettempdir tempdir = _get_default_tempdir() File "/usr/lib/python3.8/tempfile.py", line 357, in _get_default_tempdir raise FileNotFoundError(_errno.ENOENT, FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/cuke/work']
时间: 2023-09-11 14:08:38 浏览: 121
Python基础全套教程 细致讲解新手必备课件
这个错误提示显示找不到可用的临时目录,这可能是由于您的系统设置或权限问题导致的。您可以尝试以下步骤来解决此问题:
1. 确保您有足够的权限来创建临时文件夹。如果您使用的是Linux系统,请使用sudo或root用户来执行命令。
2. 检查您的系统是否设置了TMPDIR环境变量,如果设置了,请确保该目录存在并可用。
3. 您还可以尝试手动设置临时文件夹的路径。在终端中运行以下命令:
```
export TMPDIR=/usr/tmp
```
将“/usr/tmp”替换为您想要使用的临时文件夹的路径。
尝试上述步骤后,再次运行pip install paho-mqtt命令来安装paho-mqtt库。
阅读全文