尝试使用pip安装p5时出现“错误:命令错误,退出状态1:”

时间:2020-08-07 14:15:28

标签: python python-3.x numpy pip

C:\Users\Oskar>pip install p5
Collecting p5
 Using cached p5-0.6.0-py3-none-any.whl (100 kB)
Collecting triangle
 Using cached triangle-20200424-cp38-cp38-win32.whl (1.4 MB)
Requirement already satisfied: numpy in c:\users\oskar\appdata\local\programs\python\python38-32\lib\site-packages (from p5) (1.19.1)
Collecting vispy
 Using cached vispy-0.6.4.tar.gz (13.3 MB)
 Installing build dependencies ... error
 ERROR: Command errored out with exit status 1:
  command: 'c:\users\oskar\appdata\local\programs\python\python38-32\python.exe' 'c:\users\oskar\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Oskar\AppData\Local\Temp\pip-build-env-mku2s554\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel 'setuptools>=30.3.0' setuptools_scm setuptools_scm_git_archive 'Cython>=0.29.2' 'numpy; python_version=='"'"'2.7'"'"'' 'numpy==1.13.3; python_version=='"'"'3.5'"'"'' 'numpy==1.13.3; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"''
      cwd: None
 Complete output (298 lines):
 Ignoring numpy: markers 'python_version == "2.7"' don't match your environment
 Ignoring numpy: markers 'python_version == "3.5"' don't match your environment
 Ignoring numpy: markers 'python_version == "3.6"' don't match your environment

我一直尝试使用pip安装p5,但出现此错误。我尝试重新安装python(3.8.5),并完成了pip install -U setuptools。我该如何解决?

1 个答案:

答案 0 :(得分:0)

使用多个版本的python似乎是一个问题。

如果您正在python版本中使用此模块,请说3.8,然后运行:

python3.8 -m pip install p5 --user

对于3.7版,您可以这样做:

python3.7 -m pip install p5 --user

还考虑使用虚拟环境

[编辑] 我做了进一步的研究,发现您可能有一些未满足的依赖关系。 您是否已安装 glfw 并将其添加到path?如果没有遵循here

[编辑2] 该问题似乎尚未解决,希望您发现this有用

[编辑3] 添加了--user标志