`pip install pygments` incomplete installation at startup as the build phase in Xcode

I execute the command:

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

as part of my build process in the KIVI iOS project. When I run the command myself in the terminal, pygments is installed correctly. When Xcode launches it, the pygments package does not install files in the pygments/formatters .

I checked that the same pip is used for my user and when Xcode starts pip .

Output when I install 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 

Output when Xcode executes the same command:

 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 

I uploaded a file that pip loads and checks it, contains files in the formatters directory. I checked that the same pip program is used for both me and Xcode:

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

How or why would the software incorrectly unzip or install pigments when launched directly in the build phase of Xcode?

+5
source share
1 answer

This was a PEBKAC problem. Kivy iOS projects have several default steps, and one of them is to delete all * .py files in the application directory. This is usually normal, because before that a step is performed that compiles all .py files into .pyc. But my build steps had the pip install command run after the compilation step. Thus, all .py files were deleted in the Pygments directory before they were compiled into .pyc.

+3
source

Source: https://habr.com/ru/post/1247085/


All Articles