在XCode中作为构建阶段运行时,python – “pip install pygments”不完整安装

前端之家收集整理的这篇文章主要介绍了在XCode中作为构建阶段运行时,python – “pip install pygments”不完整安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在运行命令:

pip -v install pygments==2.0.2 --force-reinstall --ignore-installed --target .

作为我在Kivy iOS项目中构建过程的一部分.当我在终端中自己运行命令时,pygments已正确安装.当XCode运行它时,pygments包不会在pygments / formatters目录中安装任何文件.

我已经验证了同一个pip用于我的用户以及XCode运行pip时.

安装pygments时的输出

(rdoherty.local) %% pip -v install pygments==2.0.2 --force-reinstall --ignore-installed --target .                                       ~/Documents/projects/kivy-ios/racecapture-ios/YourApp (master)
Downloading/unpacking pygments==2.0.2
  Could not fetch URL https://pypi.python.org/simple/pygments/2.0.2: 404 Client Error: Not Found
  Will skip URL https://pypi.python.org/simple/pygments/2.0.2 when looking for download links for pygments==2.0.2
  [snip]
  Using version 2.0.2 (newest of versions: 2.0.2,2.0.2)
  Downloading Pygments-2.0.2-py2-none-any.whl (672kB):
  Downloading from URL https://pypi.python.org/packages/2.7/P/Pygments/Pygments-2.0.2-py2-none-any.whl#md5=98f29db02f4b22f58a2d3f60646e1e1f (from https://pypi.python.org/simple/pygments/)
...Downloading Pygments-2.0.2-py2-none-any.whl (672kB): 672kB downloaded
Installing collected packages: pygments
Successfully installed pygments

Xcode运行完全相同的命令时的输出

Downloading/unpacking pygments==2.0.2
  Could not fetch URL https://pypi.python.org/simple/pygments/2.0.2: 404 Client Error: Not Found
  [snip]
  Using version 2.0.2 (newest of versions: 2.0.2,2.0.2)
  Downloading from URL https://pypi.python.org/packages/2.7/P/Pygments/Pygments-2.0.2-py2-none-any.whl#md5=98f29db02f4b22f58a2d3f60646e1e1f (from https://pypi.python.org/simple/pygments/)
Installing collected packages: pygments
Successfully installed pygments

我已下载pip下载的文件并验证它包含formatters目录中的文件.我已经验证了同一个pip程序正用于我自己和XCode:

(rdoherty.local) %% which pip                                                                                                            ~/Documents/projects/kivy-ios/racecapture-ios/YourApp (master)
/usr/local/bin/pip

在Xcode构建阶段直接运行时,如何或为什么会错误地解压缩或安装pygments?

最佳答案
这是一个PEBKAC问题. Kivy iOS项目有一些默认的构建步骤,其中一个是删除应用程序目录中的所有* .py文件.通常这很好,因为在此之前有一个步骤将所有.py文件编译为.pyc.但是我的构建步骤在编译步骤之后运行了pip install命令.因此,在将它们编译为.pyc之前,所有.py文件都在Pygments目录中被删除.
原文链接:https://www.f2er.com/python/438541.html

猜你在找的Python相关文章