Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload failed (400): Binary wheel for an unsupported platform #46

Closed
np1 opened this issue May 7, 2014 · 28 comments
Closed

Upload failed (400): Binary wheel for an unsupported platform #46

np1 opened this issue May 7, 2014 · 28 comments

Comments

@np1
Copy link

np1 commented May 7, 2014

Hi, I followed the instructions on the website (pip install wheel, universal=1 in setup.cfg) but when I tried uploading to pypi with: python setup.py sdist bdist_wheel upload I got the following output:

[...]
installing to build/bdist.linux-i686/wheel
running install
running install_egg_info
Copying mps.egg-info to build/bdist.linux-i686/wheel/mps-0.20.10.data/purelib/mps-0.20.10.egg-info
running install_scripts
creating build/bdist.linux-i686/wheel/mps-0.20.10.data/scripts
copying build/scripts-2.7/mps -> build/bdist.linux-i686/wheel/mps-0.20.10.data/scripts
changing mode of build/bdist.linux-i686/wheel/mps-0.20.10.data/scripts/mps to 775
creating build/bdist.linux-i686/wheel/mps-0.20.10.dist-info/WHEEL
running upload
Submitting dist/mps-0.20.10.tar.gz to https://pypi.python.org/pypi
Server response (200): OK
Submitting /f/h/projects/github/mps/dist/mps-0.20.10-cp27-none-linux_i686.whl to https://pypi.python.org/pypi
Upload failed (400): Binary wheel for an unsupported platform

This is the first time I have tried using wheel, does anyone know what the issue is? This is the setup.py I was using: https://raw.githubusercontent.com/np1/mps/master/setup.py

@ghickman
Copy link
Collaborator

ghickman commented May 8, 2014

@np1 – Sorry for the confusion, this repo is for the information site http://pythonwheels.com.

However I believe at this time you can't upload linux wheels to the PyPI because the wheel spec doesn't account for the various linux platforms.

The official wheel repo is https://bitbucket.org/pypa/wheel and there is also the #pypa channel on freenode where the developers of the spec and tools are around to lend a hand =)

@ghickman ghickman closed this as completed May 8, 2014
@np1
Copy link
Author

np1 commented May 8, 2014

Hi, thanks for the explanation. I realise this is the repo for that site. It said on there to raise an issue if there are any problems with the page. It might be worth adding a note to say that the python setup.py sdist bdist_wheel upload command doesn't work on Linux.

@meshy
Copy link
Owner

meshy commented May 8, 2014

Hi there :)

It should work when not building for a specific platform, it's only if you need to build for linux in particular that this is a problem.

There's something on the page with regard to this (well I suppose it doesn't explicitly mention linux):

screenshot from 2014-05-08 13 32 54

Not having linux specific wheels is a pain for me too, as that's my platform of choice.

@np1
Copy link
Author

np1 commented May 8, 2014

Hi, thanks. I'm still trying to understand this. I wasn't aware I was building for a specific platform. My project is targeted at Win, Linux and Mac. Where is the platfrom even specified? Is it in the classifiers on pypi? Would I need to run the setup.py bdist_wheel command on a Mac and Windows machine to create and upload wheels for those platforms then?

@meshy
Copy link
Owner

meshy commented May 8, 2014

To be honest, I've not tried to make platform specific packages before, but I suspect that is probably has something to do with this line in your setup.py:

"Operating System :: POSIX :: Linux",

Does it work if you remove it?

@np1
Copy link
Author

np1 commented May 8, 2014

Not sure. I will register an account at https://testpypi.python.org/pypi and report back..

@meshy
Copy link
Owner

meshy commented May 8, 2014

You should be able to generate the wheel with python setup.py bdist_wheel. That will not upload to PyPI, and you could just check the name of the file generated.

@meshy
Copy link
Owner

meshy commented May 8, 2014

It should be something like /f/h/projects/github/mps/dist/mps-0.20.10-cp27-none-any.whl

@ghickman
Copy link
Collaborator

ghickman commented May 8, 2014

Hah, @meshy beat me to it ;)

@meshy
Copy link
Owner

meshy commented May 8, 2014

;)

@np1
Copy link
Author

np1 commented May 8, 2014

right ok..

classifiers in setup.py:

   classifiers=[
        "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
        "Environment :: Console",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.0",
        "Programming Language :: Python :: 3.1",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: 3.4",
        "Development Status :: 5 - Production/Stable",
        "Topic :: Utilities",
        "Topic :: Multimedia :: Sound/Audio :: Players",
        "Topic :: Internet :: WWW/HTTP"],
)
$ python setup.py bdist_wheel
running bdist_wheel
running build
running build_scripts
installing to build/bdist.linux-i686/wheel
running install
running install_egg_info
running egg_info
writing mps.egg-info/PKG-INFO
writing top-level names to mps.egg-info/top_level.txt
writing dependency_links to mps.egg-info/dependency_links.txt
reading manifest file 'mps.egg-info/SOURCES.txt'
writing manifest file 'mps.egg-info/SOURCES.txt'
Copying mps.egg-info to build/bdist.linux-i686/wheel/mps-0.20.14.data/purelib/mps-0.20.14.egg-info
running install_scripts
creating build/bdist.linux-i686/wheel/mps-0.20.14.data/scripts
copying build/scripts-2.7/mps -> build/bdist.linux-i686/wheel/mps-0.20.14.data/scripts
changing mode of build/bdist.linux-i686/wheel/mps-0.20.14.data/scripts/mps to 775
creating build/bdist.linux-i686/wheel/mps-0.20.14.dist-info/WHEEL

The wheel file created in dist/ is mps-0.20.14-cp27-none-linux_i686.whl

@ghickman
Copy link
Collaborator

ghickman commented May 8, 2014

@np1 – What's in your setup.cfg?

@np1
Copy link
Author

np1 commented May 8, 2014

setup.cfg:

[bdist_wheel]
universal = 1

If I delete the setup.cfg (and again without POSIX :: Linux in classifiers) I get this:

$ python setup.py bdist_wheel
running bdist_wheel
running build
running build_scripts
copying and adjusting mps -> build/scripts-2.7
installing to build/bdist.linux-i686/wheel
running install
running install_egg_info
running egg_info
writing mps.egg-info/PKG-INFO
writing top-level names to mps.egg-info/top_level.txt
writing dependency_links to mps.egg-info/dependency_links.txt
reading manifest file 'mps.egg-info/SOURCES.txt'
writing manifest file 'mps.egg-info/SOURCES.txt'
Copying mps.egg-info to build/bdist.linux-i686/wheel/mps-0.20.14.data/purelib/mps-0.20.14.egg-info
running install_scripts
creating build/bdist.linux-i686/wheel/mps-0.20.14.data/scripts
copying build/scripts-2.7/mps -> build/bdist.linux-i686/wheel/mps-0.20.14.data/scripts
changing mode of build/bdist.linux-i686/wheel/mps-0.20.14.data/scripts/mps to 775
creating build/bdist.linux-i686/wheel/mps-0.20.14.dist-info/WHEEL

It's the same output as previously apart from the line: copying and adjusting mps -> build/scripts-2.7

@meshy
Copy link
Owner

meshy commented May 8, 2014

I must be honest, I'm a little bit stumped as to why this could be happening, and I'm starting to think that @ghickman's suggestion...

#pypa channel on freenode

...might be the best port of call for now.

@meshy
Copy link
Owner

meshy commented May 8, 2014

That said, just a thought, perhaps try deleting the setup.pyc file, and dist directory, just for good measure before trying again.

@np1
Copy link
Author

np1 commented May 8, 2014

I deleted all the generated files:
rm -rf dist/ mps.egg-info/ build/ setup.pyc
and tried again but still the same output and it created dist/mps-0.20.14-cp27-none-linux_i686.whl

Thanks both for your help :) I will try irc.

@ghickman
Copy link
Collaborator

ghickman commented May 8, 2014

@np1 – Sorry we couldn't find a solution =(

@meshy
Copy link
Owner

meshy commented May 8, 2014

@np1 Yeah, sorry about that. When you figure it out, please come back and let us know what the problem was. I'm super curious! :)

@np1
Copy link
Author

np1 commented May 8, 2014

I found the answer by going through the issue list on Bitbucket. It's marked as resolved although I consider it a bug!
https://bitbucket.org/pypa/wheel/issue/65/distributions-without-any-modules-are

When no modules or packages are specified in setup.py (I only have a script specified in mine), it creates a platform specific wheel.

I tested by creating a dummy .py module and specifying it withpy_modules=['dummy.py'] in setup.py and it succesfully created dist/mps-0.20.14-py2.py3-none-any.whl

Since most projects will have modules or packages specified I guess it's not a big problem. I will change my setup.py to use entry_points['console_scripts'] instead of the scripts=['mps'] entry

@meshy
Copy link
Owner

meshy commented May 8, 2014

Wow that is obscure. Pretty sure I'd not have worked that out.

I consider it a bug!

Yeah, it looks to me as though it should be throwing an exception, not just acting strangely without warning.

Glad you have a solution, anyway, and thanks for coming back to explain :)

@ghickman
Copy link
Collaborator

ghickman commented May 8, 2014

Oh wow that's super obscure! Good find @np1!

@hickford
Copy link

hickford commented Jan 4, 2016

Upload failed (400): Binary wheel for an unsupported platform

It would be helpful if the error message gave more detail. What is the platform that's not supported? Which platforms are supported? The wheels I'm trying to upload are built for Windows so I don't understand why PyPI rejects them.

How does PyPI deduce the platform for a binary wheel anyway? From the filename, or from metadata inside the archive?

@hickford
Copy link

I'm still struggling to upload my wheel. Can anyone help?

  1. Which platforms does PyPI support?
  2. How does PyPI determine the platform of my wheel?

@meshy
Copy link
Owner

meshy commented Feb 23, 2016

@hickford I think you should read @ghickman's first comment on this thread.

@hickford
Copy link

@meshy
Copy link
Owner

meshy commented Feb 23, 2016

@hickford 👍 thanks :)

@todofixthis
Copy link

I tried a few strategies to work around this issue, but I'm not able to squash that generic linux platform tag.

In my case, it may be an issue with Travis CI; I've reached out to their support team for assistance.

In the meantime, here are some of the ways that I tried to work around this issue:

If you were able to successfully work around this issue, please post what you tried; I could use some inspiration (:

@meshy
Copy link
Owner

meshy commented Oct 14, 2017

@todofixthis I'm sorry, this isn't the right place to search for assistance on this issue. As @ghickman explained in the first comment here, this site is informational. Specifically, it's a graphic that visualises wheel support in the 360 most downloaded packages on PyPI.

I'm sure the folks at TravisCI will be able to help you better understand the issue, but if not, as @ghickman said, you should be able to also get assistance at the official wheel repo: https://bitbucket.org/pypa/wheel or the #pypa channel on freenode (IRC) where the developers of the spec and tools are around to lend a hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants