You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Windows上pip安装Psychopy的报错及运行问题求助

Fixes for Psychopy Import Errors in Anaconda Spyder 2.7

Hey there, let's work through these frustrating import errors you're facing in your 64-bit Anaconda Spyder 2.7 environment. These issues almost always boil down to incompatible dependency versions—since Python 2.7 is end-of-life, newer library releases don't support it anymore. Here's what's worked for me and other developers in your situation:

The pyglet library you have installed is likely too new for Python 2.7 and your Psychopy version. Roll back to a compatible release:

  1. First, activate your Anaconda environment in the command prompt:
    conda activate your_spyder27_env_name
    
  2. Install the last pyglet version that works with Python 2.7:
    pip install pyglet==1.3.2
    
    If conda throws an error, use the pip command above—it's more reliable for this specific version.

2. Reinstall a Python 2.7-compatible Psychopy version

The latest Psychopy versions dropped support for Python 2.7 entirely. Uninstall your current installation and install the last supported release:

pip uninstall psychopy -y
pip install psychopy==1.85.6

This version is specifically built to work with Python 2.7 and avoids many dependency conflicts.

3. Resolve the PUINT NameError

This error stems from mismatched numpy or pygame versions. Here's how to fix it:

  • First, install a numpy version compatible with Python 2.7:
    conda install numpy==1.16.6
    
  • If the error persists, reinstall a Python 2.7-friendly pygame release:
    pip install pygame==1.9.6
    

PUINT is a type definition that exists in these older, compatible library versions.

4. Double-check your environment setup

  • Confirm Spyder is using the correct interpreter: Go to Tools > Preferences > Python interpreter in Spyder, and make sure the path points to the Python executable in your Anaconda 2.7 environment.
  • Restart Spyder completely after making any dependency changes—old cached imports can stick around and cause weird issues even after fixes are applied.

内容的提问来源于stack exchange,提问作者Ravi Mevada

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 06:27:03