############ Running: /Users/Wu/Desktop/GUI_design/utils/Resting.py ############ 2023-07-15 19:34:58.930 python[2077:28743] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/cm/h6r34k6d7x5b9n9yg8m072_w0000gn/T/org.opensciencetools.psychopy.savedState Traceback (most recent call last): File "/Users/Wu/Desktop/GUI_design/utils/Resting.py", line 4, in <module> from utils.Join import Join ModuleNotFoundError: No module named 'utils' ################# Experiment ended with exit code 1 [pid:2077] ################# ]
时间: 2023-08-20 22:05:26 浏览: 369
根据错误信息,你的代码在 `Resting.py` 文件中无法找到名为 'utils' 的模块。这可能是由于以下原因之一导致的:
1. 模块路径错误:请确保在 `Resting.py` 文件中正确导入了 'utils' 模块,并且路径是正确的。你可以检查导入语句,确认路径是否正确。
2. 缺少模块:如果确实缺少 'utils' 模块,你需要确认该模块是否已正确安装。请确保 'utils' 模块已通过 `pip` 或其他适当的方式进行安装。
3. 文件或文件夹命名问题:请确保文件和文件夹的命名是正确的,确保大小写一致,并且文件和文件夹的名称没有任何特殊字符或空格。
请检查以上几点,并尝试解决问题。如果问题仍然存在,请提供更多的代码和错误信息,以便我能够更好地帮助你。
相关问题
Welcome to PsychoPy3! v2023.1.3 ################ Running: /Users/Wu/Desktop/GUI_design/demo1.py ################ 2023-07-15 19:27:22.311 python[1509:19794] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/cm/h6r34k6d7x5b9n9yg8m072_w0000gn/T/org.opensciencetools.psychopy.savedState 1.6979 WARNING psychopy.parallel has been imported on a Mac (which doesn't have a parallel port?) Traceback (most recent call last): File "/Users/Wu/Desktop/GUI_design/demo1.py", line 9, in <module> from utils.Resting import Resting File "/Users/Wu/Desktop/GUI_design/utils/Resting.py", line 7, in <module> from utils.basics.Score import Score File "/Users/Wu/Desktop/GUI_design/utils/basics/Score.py", line 7, in <module> from utils.basics.ratingscale import RatingScale File "/Users/Wu/Desktop/GUI_design/utils/basics/ratingscale.py", line 31, in <module> from past.builtins import basestring ModuleNotFoundError: No module named 'past' ################# Experiment ended with exit code 1 [pid:1509] #################怎么解决
根据错误信息,问题仍然是缺少名为'past'的模块。你可以尝试使用以下命令安装它:
```
pip install future
```
如果你使用的是 Python 3,请使用以下命令:
```
pip3 install future
```
如果安装成功,但问题仍然存在,请确保你的代码中正确导入了所需的模块,并且模块的路径是正确的。此外,还可以尝试更新 PsychoPy 到最新版本,以确保你使用的是最新的稳定版本。
如果问题仍然无法解决,可能需要进一步检查你的代码和依赖项,确保所有相关模块都已正确安装并可访问。
2023-07-15 19:27:22.311 python[1509:19794] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/cm/h6r34k6d7x5b9n9yg8m072_w0000gn/T/org.opensciencetools.psychopy.savedState 1.6979 WARNING psychopy.parallel has been imported on a Mac (which doesn't have a parallel port?) Traceback (most recent call last): File "/Users/Wu/Desktop/GUI_design/demo1.py", line 9, in <module> from utils.Resting import Resting File "/Users/Wu/Desktop/GUI_design/utils/Resting.py", line 7, in <module> from utils.basics.Score import Score File "/Users/Wu/Desktop/GUI_design/utils/basics/Score.py", line 7, in <module> from utils.basics.ratingscale import RatingScale File "/Users/Wu/Desktop/GUI_design/utils/basics/ratingscale.py", line 31, in <module> from past.builtins import basestring ModuleNotFoundError: No module named 'past' ################# Experiment ended with exit code 1 [pid:1509] #################
根据你提供的信息,看起来你的代码中少一个名为'past'的模块。这可能是因为你的Python环境中没有安装此模块。你可以尝试在终端中使用以下命令安装它:
```
pip install future
```
如果你使用的是 Python 3,请使用以下命令:
```
pip3 install future
```
安装完成后,再次运行代码,看看问题是否解决了。如果问题仍然存在,请确保你的代码中正确导入了所需的模块,并且模块的路径是正确的。
阅读全文