module 'psutil' has no attribute 'sensors_temperatures'
时间: 2023-09-21 07:02:59 浏览: 65
As an AI language model, I cannot see your code or system configuration. However, the error message suggests that the `psutil` module does not have an attribute called `sensors_temperatures`. This may be due to a version mismatch or a missing dependency.
To resolve this issue, you can try the following steps:
1. Ensure that you have the latest version of `psutil` installed:
```python
pip install --upgrade psutil
```
2. Verify that `psutil` is imported correctly:
```python
import psutil
```
3. Check if `sensors_temperatures` is available in your version of `psutil`:
```python
if hasattr(psutil, "sensors_temperatures"):
# use sensors_temperatures
else:
# handle the case when sensors_temperatures is not available
```
4. If `sensors_temperatures` is not available, try installing the `lm-sensors` package on your system:
```bash
sudo apt-get install lm-sensors
```
5. Finally, restart your Python interpreter and try again.
If these steps do not resolve the issue, you may need to provide more information about your system configuration and the code you are running.