我正在尝试在Mac上安装Python 3上的心理,但我收到错误:
pip3 install psychopy
Collecting psychopy
Using cached PsychoPy-1.84.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/private/var/folders/39/88clnp910zlg54lrgy0d7qm40000gn/T/pip-build-ddca2hwz/psychopy/setup.py”, line 28, in
exec(vStr)
File “”, line 42, in
File “/private/var/folders/39/88clnp910zlg54lrgy0d7qm40000gn/T/pip-build-ddca2hwz/psychopy/psychopy/init.py”, line 47, in
from psychopy.tools.versionchooser import useVersion, ensureMinimal
File “/private/var/folders/39/88clnp910zlg54lrgy0d7qm40000gn/T/pip-build-ddca2hwz/psychopy/psychopy/tools/versionchooser.py”, line 19, in
from psychopy import logging, tools, web
File “/private/var/folders/39/88clnp910zlg54lrgy0d7qm40000gn/T/pip-build-ddca2hwz/psychopy/psychopy/web.py”, line 13, in
import httplib
ImportError: No module named ‘httplib’
----------------------------------------
Command “python setup.py egg_info” failed with error code 1 in /private/var/folders/39/88clnp910zlg54lrgy0d7qm40000gn/T/pip-build-ddca2hwz/psychopy/
我试图安装“httplib”,但也没有运气:
pip3 install httplib
Collecting httplib
Could not find a version that satisfies the requirement httplib (from versions: )
No matching distribution found for httplib
我该如何安装?
答案 0 :(得分:1)
导入httplib
时出错的原因是using Python 2 code with Python 3。 httplib
是Python 2.x提供的内置库 - 它不能与Pip一起安装,并且已在Python 3中重命名为http.client
。
检查installation instructions后,从版本1.85.4开始,Python 3似乎不受支持:
依赖关系
你需要从这里获得Python 2.7.x的副本,wxPython和pyo(或者使用下面列出的替代音频库)。
不幸的是,你需要安装和使用Python 2.7,因为Python 3不起作用,即使你自己修复了httplib
的直接问题,你也可能会遇到许多Python 3错误。 / p>
答案 1 :(得分:0)
Oren在PsychoPy论坛上重复了这个问题,我在那里回答了这个问题: https://discourse.psychopy.org/t/cant-install-psychopy-in-python3-mac/3573/5
PsychoPy的存储库版本现在兼容,但正如Jonas所说,它是一个主要的重构(需要从wx3升级到wx4)并且很可能有bug。除非你知道你在做什么,否则不推荐。