【问题标题】:installation of vpython using pip in High Sierra在 High Sierra 中使用 pip 安装 vpython
【发布时间】:2018-07-10 19:07:00
【问题描述】:

我在使用pip 安装vpython 时遇到问题。在安装过程中,我得到错误,好像我没有stdio.h,我确实这样做了

In file included from _scandir.c:14:
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1


Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/mf/h7c_zhyd7yl6t7nkgx10j6pw0000gq/T/pip-build-czavCr/scandir/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/mf/h7c_zhyd7yl6t7nkgx10j6pw0000gq/T/pip-is5WM1-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/mf/h7c_zhyd7yl6t7nkgx10j6pw0000gq/T/pip-build-czavCr/scandir/

我正在运行 High Sierra,最新的 Xcode

网络上的大多数帖子都建议安装命令行工具 xcode-select --install 但我做到了,我可以很好地编译我的一些代码。 我尝试过的其他事情:

  1. 删除并重新安装 xcode+命令行工具
  2. 删除/Library/Developer/CommandLineTools/
  3. CFLAGS=-stdlib=libc++ pip install vpython
  4. MACOSX_DEPLOYMENT_TARGET=10.13 pip install vpython

但没有任何效果。我完全没有想法

【问题讨论】:

    标签: pip macos-high-sierra vpython


    【解决方案1】:

    我无法理解上述问题,但我设法找到了两种解决方法来获得 vpython 的工作版本。不知何故,这个问题似乎与我从 python.org 安装的 python 包和包含的 pip 有关。我删除了它并使用 Homebrew 安装了 python2 和 python3,并且 pip2 和 pip3 都成功安装了 vpython 和其他模块。

    另一种似乎更好的替代方法是安装 Anaconda Python,然后使用 conda 获取 vphyton。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-09
      • 2018-12-05
      • 2018-06-16
      • 2023-03-25
      • 2019-02-23
      • 2018-06-02
      • 2018-06-18
      相关资源
      最近更新 更多