python setup.py install pycparser

最近在使用tensorflow里的object detection api模块,涉及到了python的setup.py的使用。

(1)管理员身份打开命令行客户端,将路径变到setup.py的文件目录下 
注:从C:\Windows\System32路径转到其他路径需要使用cd\或cd..退至根目录,然后再变换到其他盘路径,如F:

参考博客:制作Python的安装模块 
(2)然后运行安装代码

python setup.py install
1安装成功后会再python的安装目录下Lib\sit-packages找到安装的模块

如果没有问题就可以导入import导入使用了

注:python的打包文件有egg文件和wheel文件,可用于安装第三方组件package

C:\Python27\Lib\site-packages\pycparser-2.19>python setup.py install
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\pycparser
copying pycparser\ast_transforms.py -> build\lib\pycparser
copying pycparser\c_ast.py -> build\lib\pycparser
copying pycparser\c_generator.py -> build\lib\pycparser
copying pycparser\c_lexer.py -> build\lib\pycparser
copying pycparser\c_parser.py -> build\lib\pycparser
copying pycparser\lextab.py -> build\lib\pycparser
copying pycparser\plyparser.py -> build\lib\pycparser
copying pycparser\yacctab.py -> build\lib\pycparser
copying pycparser\_ast_gen.py -> build\lib\pycparser
copying pycparser\_build_tables.py -> build\lib\pycparser
copying pycparser\__init__.py -> build\lib\pycparser
creating build\lib\pycparser\ply
copying pycparser\ply\cpp.py -> build\lib\pycparser\ply
copying pycparser\ply\ctokens.py -> build\lib\pycparser\ply
copying pycparser\ply\lex.py -> build\lib\pycparser\ply
copying pycparser\ply\yacc.py -> build\lib\pycparser\ply
copying pycparser\ply\ygen.py -> build\lib\pycparser\ply
copying pycparser\ply\__init__.py -> build\lib\pycparser\ply
copying pycparser\_c_ast.cfg -> build\lib\pycparser
running install_lib
running install_egg_info
running egg_info
writing pycparser.egg-info\PKG-INFO
writing dependency_links to pycparser.egg-info\dependency_links.txt
writing top-level names to pycparser.egg-info\top_level.txt
reading manifest file 'pycparser.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching 'setup.pyc'
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
writing manifest file 'pycparser.egg-info\SOURCES.txt'
removing 'D:\Program Files (x86)\Python37\Lib\site-packages\pycparser-2.19-py3.7.egg-info' (and everything under it)
Copying pycparser.egg-info to D:\Program Files (x86)\Python37\Lib\site-packages\pycparser-2.19-py3.7.egg-info
running install_scripts
Build the lexing/parsing tables

你可能感兴趣的:(python)