当我运行命令pip install allennlp时,输出如下所示。Building wheel for xxx的含义是什么?Building wheel for xxx背后的行动是什么?
Building wheel for jsonnet (setup.py) ... done
Stored in directory: /Users/xu/Library/Caches/pip/wheels/f0/47/51/a178b15274ed0db775a1ae9c799ce31e511609c3ab75a7dec5
Building wheel for nltk (setup.py) ... done
Stored in directory: /Users/xu/Library/Caches/pip/wheels/97/8a/10/d646015f33c525688e91986c4544c68019b19a473cb33d3b55
Building wheel for parsimonious (setup.py) ... done我做了一些搜索,似乎wheel是一种帮助pip设置包的文件,但我仍然没有一个明确的理解。我知道这个问题可能是个愚蠢的问题,知道答案会很好。
发布于 2019-05-26 00:01:11
我假设您已经了解了以下文档:
使用pip install allennlp与-vvv一起运行提供了更多与您的特定问题相关的见解:
Created temporary directory: /private/var/folders/kh/1cpkyp_535jg856yrdnql0rw0000gn/T/pip-install-leyfrduz
...
Created temporary directory: /private/var/folders/kh/1cpkyp_535jg856yrdnql0rw0000gn/T/pip-wheel-s1uhiijv
Building wheel for jsonnet (setup.py) ... Destination directory: /private/var/folders/kh/1cpkyp_535jg856yrdnql0rw0000gn/T/pip-wheel-s1uhiijv
Running command /Users/subhashb/.pyenv/versions/3.7.2/envs/test-env-dev/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/kh/1cpkyp_535jg856yrdnql0rw0000gn/T/pip-install-leyfrduz/jsonnet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/kh/1cpkyp_535jg856yrdnql0rw0000gn/T/pip-wheel-s1uhiijv --python-tag cp37
running bdist_wheel
running build
running build_ext
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 -Ithird_party/json core/desugarer.cpp -o core/desugarer.o
core/desugarer.cpp:406:67: warning: unused parameter 'obj_level' [-Wunused-parameter]
AST* makeArrayComprehension(ArrayComprehension *ast, unsigned obj_level) {
...
writing manifest file 'jsonnet.egg-info/SOURCES.txt'
Copying jsonnet.egg-info to build/bdist.macosx-10.14-x86_64/wheel/jsonnet-0.12.1-py3.7.egg-info
running install_scripts
adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
creating build/bdist.macosx-10.14-x86_64/wheel/jsonnet-0.12.1.dist-info/WHEEL
creating '/private/var/folders/kh/1cpkyp_535jg856yrdnql0rw0000gn/T/pip-wheel-s1uhiijv/jsonnet-0.12.1-cp37-cp37m-macosx_10_14_x86_64.whl' and adding 'build/bdist.macosx-10.14-x86_64/wheel' to it
adding '_jsonnet.cpython-37m-darwin.so'
adding 'jsonnet-0.12.1.dist-info/LICENSE'
adding 'jsonnet-0.12.1.dist-info/METADATA'
adding 'jsonnet-0.12.1.dist-info/WHEEL'
adding 'jsonnet-0.12.1.dist-info/top_level.txt'
adding 'jsonnet-0.12.1.dist-info/RECORD'
removing build/bdist.macosx-10.14-x86_64/wheel
done使这个漂亮的进程运行的pip包代码位于github。最后,它打了一个电话给jsonnet的Makefile,让它“建造”车轮。
简而言之,以jsonnet为例,运行pip install jsonnet可以执行以下操作:
c++命令来编译.cpp文件_jsonnet.cpython-37m-darwin.so (这是我的Mac计算机的正确库格式)jsonnet-0.12.1.dist-info中记录车轮分布信息(通常出现在虚拟env中)这个流是针对jsonnet的,它恰好有点复杂,因为jsonnet是一个最后的C扩展。但是常规的python包只需要下载源文件并安装在虚拟环境中。您可以走相同的路径来理解任何包背后发生的事情。
https://stackoverflow.com/questions/56309251
复制相似问题