question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip install fails: incorrect metadata

See original GitHub issue

Installing deepchem using pip 20.3 results in the following error message:

$ pip install deepchem 
Collecting deepchem
  Using cached deepchem-2.4.0rc1.dev20201119053907.tar.gz (401 kB)
ERROR: Requested deepchem from https://files.pythonhosted.org/packages/fb/32/087
7d24af313f071d7b2b93765c5759a861b46e603176d21bb339e2013cd/deepchem-2.4.0rc1.dev2
0201119053907.tar.gz#sha256=e886573f12a52fd62a460835629daa4f2236e0a2926ec9766b7f
02c89fc8412b has different version in metadata: '2.4.0rc1.dev20201204104606'  

Apparently, there are two slightly different timestamps used in the packaging of a deepchem release for pypi.

This seems to be related to the new resolver used by pip, since using pip version 20.2 this error only occurs if --use-feature=2020-resolver is used.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nissy-devcommented, Dec 10, 2020

As @LarsAC mentioned, the workaround is the following command.

$ pip install --use-deprecated=legacy-resolver --pre deepchem

The reason why this error happen is that we publish only tar.gz file through PyPI, not wheel file.

I understood how pip install works from this URL : https://pydist.com/blog/pip-install. When we run pip install some_package, firstly the PyPI resolver searches a wheel file which is a built-package format. If the resolver don’t find a wheel file, it searches a tar.gz file and build some_package. In the case of tar.gz file, the resolver need to build the package. (On the other hand, there is no need in the case of wheel).

Now, DeepChem published only tar.gz file, so PyPI resolver find deepchem-2.4.0rc1.dev20201119053907.tar.gz(latest package) and build it when running pip instal --pre deepchem. But, the package version which is built by PyPI will be deepchem-2.4.0rc1.dev.build_time (built_time is the time when installing) based on our versioning logic in setup.py. So, PyPI raise the reported error (version mismatch).

I think this issue will be resolved by publishing wheel file. The wheel file is more appropriate file format when publishing the package. This is because the wheel file is faster to install without building.

I will try to fix in #2294

1reaction
LarsACcommented, Dec 9, 2020

For use of pip 20.3 I could solve using additional option --use-deprecated=legacy-resolver. As per pip documentation, this option will go away in 21.0, though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Pip cannot find metadata file - EnvironmentError
I have held broken packages so after trying that, I just get a new error that says: Could not install packages due to...
Read more >
'METADATA' crash during 'pip install' · Issue #8676 - GitHub
It seems weird that this file cannot be read; this may be an environment issue, not a pip bug (although we should catch...
Read more >
Error: metadata-generation-failed. Encountered error while ...
To solve the error "metadata-generation-failed. Encountered error while generating package metadata", make sure your `pip` and `setuptools` ...
Read more >
note: this error originates from a subprocess, and is likely not a ...
I fixed the problem by installing an older version of pip using the command: ... a problem with pip. error: metadata-generation-failed × Encountered...
Read more >
Changelog - pip documentation v22.3.1
Ignore distributions with invalid Name in metadata instead of crashing, ... Fix pip install issues using a proxy due to an inconsistency in...
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