Skip to main content
 首页 » 编程设计

python之无法在我的 setup.py 上运行 bdist_wheel 构建命令

2025年01月19日9dflying

我创建了一个用于教育目的的 pypi 包,我想进行升级。我完成了通常的步骤(进行更改、运行 setup.py 等)

但是当我这样做的时候:

python3 setup.py bdist_wheel 

我遇到了错误

 python3 setup.py build bdist_wheel 
 usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] 
 or: setup.py --help [cmd1 cmd2 ...] 
 or: setup.py --help-commands 
 or: setup.py cmd --help 
 
error: invalid command 'bdist_wheel' 

Wheel 和 pip 已安装并且是最新的:

pip3 install wheel 
Requirement already satisfied: wheel in /usr/local/lib/python3.4/dist-  
packages (0.31.0) 

命令的帮助,好像不支持bdist_wheel。

我错过了什么吗?

    python3 setup.py --help-commands 
Standard commands: 
build             build everything needed to install 
build_py          "build" pure Python modules (copy to build directory) 
build_ext         build C/C++ extensions (compile/link to build directory) 
build_clib        build C/C++ libraries used by Python extensions 
build_scripts     "build" scripts (copy and fixup #! line) 
clean             clean up temporary files from 'build' command 
install           install everything from build directory 
install_lib       install all Python modules (extensions and pure Python) 
install_headers   install C/C++ header files 
install_scripts   install scripts (Python or otherwise) 
install_data      install data files 
sdist             create a source distribution (tarball, zip file, etc.) 
register          register the distribution with the Python package index 
bdist             create a built (binary) distribution 
bdist_dumb        create a "dumb" built distribution 
bdist_rpm         create an RPM distribution 
bdist_wininst     create an executable installer for MS Windows 
check             perform some checks on the package 
upload            upload binary package to PyPI 
 
Extra commands: 
alias             define a shortcut to invoke one or more commands 
bdist_egg         create an "egg" distribution 
develop           install package in 'development mode' 
easy_install      Find/get/install Python packages 
egg_info          create a distribution's .egg-info directory 
install_egg_info  Install an .egg-info directory for the package 
rotate            delete older distributions, keeping N newest files 
saveopts          save supplied options to setup.cfg or other config file 
setopt            set an option in setup.cfg or another config file 
test              run unit tests after in-place build 
upload_docs       Upload documentation to PyPI 
 
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] 
or: setup.py --help [cmd1 cmd2 ...] 
or: setup.py --help-commands 
or: setup.py cmd --help 

编辑:

 python3 --version 
 Python 3.6.3 
 
 
 pip3 --version 
 pip 10.0.1 from /usr/local/lib/python3.4/dist-packages/pip (python 3.4) 

请您参考如下方法:

看起来 pip 版本和 python 版本不匹配...解决这个问题就解决了。