我的 Python 包有一个 setup.py
,当我像这样配置它时,它可以在 Ubuntu Trusty 和新的 Vagrant Ubuntu Trusty VM 上本地构建:
sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7
sudo -H pip install setuptools wheel virtualenv --upgrade
但是当我在 Travis CI Trusty Beta VM 上执行相同操作时:
- sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken
- curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7
- sudo -H pip install setuptools wheel virtualenv --upgrade
我明白了:
python2.7 setup.py 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'
这个 Why can I not create a wheel in python?是相关的,但请注意我正在安装轮子并升级 setuptools。
最佳答案
必须安装 wheel
包。一切都是最新的,但仍然出现错误。
pip install wheel
然后
python setup.py bdist_wheel
工作没有问题。
关于python - 为什么 python setup.py 在 Travis CI 上说无效命令 'bdist_wheel'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34819221/