Invalid distribution metadata; `UNKNOWN` package name

See original GitHub issue

Hey guys, i have a problem when executing twine check dist/*. Since I am completely new to publishing packages I cannot fix this error. But one by one:

  1. Your operating system: Mac OS
  2. Version of python you are running:
python 3.7.6
  1. How did you install twine? Did you use your operating system’s package manager or pip or something else?
pip install twine
  1. Version of twine you have installed (include complete output of):
twine version 3.7.1 (importlib_metadata: 4.10.0, pkginfo: 1.8.2, requests:
2.26.0, requests-toolbelt: 0.9.1, tqdm: 4.42.1)
  1. Which package repository are you targeting? pypi

The Issue

Please describe the issue that you are experiencing. After building the package with python3 -m build . a MANIFEST, ipypetrinet-1.0.0.tar.gz and UNKNOWN-0.0.0-py2.py3-none-any.whl file is successfully created. After that i tried twine check dist/* which throws the following error:

Checking dist/UNKNOWN-0.0.0-py2.py3-none-any.whl: InvalidDistribution: Invalid distribution metadata. 
This version of twine supports Metadata-Version 1.0, 1.1, 1.2, 2.0, 2.1, and 2.2

But when I unzip UNKNOWN-0.0.0-py2.py3-none-any.whl and look into the files, the only file containing the keyword Metadata-Version has an appropriate Metadata-Version of 2.1. To visualize this METADATA-file I will paste the first few lines below:

Metadata-Version: 2.1
Name: UNKNOWN
Version: 0.0.0
Summary: UNKNOWN
Home-page: UNKNOWN
License: UNKNOWN
Platform: UNKNOWN
Description-Content-Type: text/markdown
License-File: LICENSE.txt

Does anyone know how to deal with this? Any help is appreciated! Thanks in advance.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bhrutledgecommented, Jan 6, 2022

Alternatively, if there’s a conflict between the JS and the Python use of dist/, then you can specify a different directory for Python:

$ python3 -m build -o py_dist

$ twine upload py_dist/*

In that case, you’d want to add py_dist to your .gitignore.

0reactions
LordHeImchencommented, Jan 6, 2022

Well I am satisfied and publishing worked, so that’s great. And thanks, I will definitely try one of these options above if i update it in a while!

All that said, I do think the InvalidDistribution error could be more helpful. I’ll leave this open for now, with the hope that I can look into that soon.

However, I’ll leave the issue open for @bhrutledge in order to have a look at the error message. So feel free to close this issue whenever you like.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid distribution metadata; `UNKNOWN` package name
Hey guys, i have a problem when executing twine check dist/* . Since I am completely new to publishing packages I cannot fix...
Read more >
Unknown distribution format: '' when uploading to PyPI via Twine
InvalidDistribution ( "Unknown distribution format: '%s'" % os.path.basename(filename) ). The basename for a directory is '' , hence the ...
Read more >
Fail installation on conflicting package metadata #7179 - GitHub
Currently pip outputs a warning if package metadata does not align with the package name indicated in a direct URL or #egg= fragment....
Read more >
Safely using setup.cfg for metadata | by David Shawley
It lets you explicitly specify the packages that are required to exist before the setuptools.setup function is run. The examples in this section ......
Read more >
Defining metadata (meta.yaml) - Conda
Specifies package information. Package name . The lower case name of the package. It may contain "-", but no spaces.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found