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

pip fails to find new package version even though it is available on PyPI website #8484

Closed
DataGreed opened this issue Jun 23, 2020 · 7 comments

Comments

@DataGreed
Copy link

Environment

  • pip version: 19.0.3
  • Python version: 3.7.3
  • OS: macOS 10.15.5
  • twine version 3.1.1 (pkginfo: 1.5.0.1, requests: 2.20.1, setuptools: 40.8.0, requests-toolbelt: 0.9.1, tqdm: 4.46.1)

Description
I can see the latest version (0.2.1) of my package here – https://pypi.org/project/django-eb-sqs-worker/

But when I try to install it I get the following:

% pip3 install django-eb-sqs-worker==0.2.1  
Collecting django-eb-sqs-worker==0.2.1
  Could not find a version that satisfies the requirement django-eb-sqs-worker==0.2.1 (from versions: 0.1.0)
No matching distribution found for django-eb-sqs-worker==0.2.1

If i don't specify the version it installs 0.1.0:

% pip3 install django-eb-sqs-worker       
Collecting django-eb-sqs-worker
Installing collected packages: django-eb-sqs-worker
Successfully installed django-eb-sqs-worker-0.1.0

Upgrading also does not work:

% pip3 install --upgrade django-eb-sqs-worker
Requirement already up-to-date: django-eb-sqs-worker in ./.venv/lib/python3.7/site-packages (0.1.0)

Interestingly, the search results show 0.2.1 as the latest version:

% pip3 search django-eb-sqs-worker   
django-eb-sqs (1.38)                              - A simple task manager for AWS SQS
django-eb-sqs-worker (0.2.1)                      - Django Background Tasks for Amazon Elastic Beanstalk
  INSTALLED: 0.1.0
  LATEST:    0.2.1
sqs-workers (0.5.2)                               - SQS Workers

Expected behavior
I expect the latest version of the package be available via pip install (0.2.1 in this case)

What I've tried

  1. First I've uploaded the new version of the package using twine which led to the problem described here
  2. I've tried the "purge" solution described in pip fails to find package even though it is available on PyPI #4888 with both https://pypi.python.org/simple/<package-name> and https://pypi.org/simple/<package-name>/ instead. addresses, but that didn't resolve the issue
  3. I've waited around 12 hours to make sure the index and cache updates, but that did not seem to help
@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Jun 23, 2020
@DataGreed DataGreed changed the title pip fails to find package even though it is available on PyPI pip fails to find new package version even though it is available on PyPI website Jun 23, 2020
@uranusjr
Copy link
Member

uranusjr commented Jun 23, 2020

I believe pip has dropped support to eggs for a while now. You’ll need to publish in sdist (tar.gz) or wheel (whl) now.

@DataGreed
Copy link
Author

@uranusjr what does it mean in practice? I've followed their tutorial to upload the first version and the next version. The first version worked flawlessly.

@uranusjr
Copy link
Member

What tutorial are you following exactly? The first version you uploaded is a tar.gz (which works as expected), and the second is egg (which does not work). So there is something you're doing differently between the two.

@DataGreed
Copy link
Author

DataGreed commented Jun 23, 2020

@uranusjr well, the official one.

Basically I did

twine upload dist/*

I believe could not have used different commands to upload different versions as I've used command from bash history and pypi should validate the packages anyway.

@McSinyx
Copy link
Contributor

McSinyx commented Jun 24, 2020

Hi @DataGreed, probably you made some mistake/typo during the build of 0.2.1—0.2.2 is looking good now. One alternative to setuptools is flit, which you might want to consider to avoid having to handle everything explicitly—flit publish will take care of setuptools' and twine's job in one go. Either way, I believe that this issue is solved and could be closed now.

This again proves my point that twine upload dist/* is confusing for new-comers in Python packaging ecosystem, regarding which file is to be uploaded.

@uranusjr
Copy link
Member

About the official guide—twine only handles the upload, so the question is how you built that egg in the first place. If you read the previous section (Generating distribution archives), python setup.py sdist bdist_wheel only generates two files, tar.gz and whl, both (as mentioned previously) should work with pip. That is why I said something must be differernt for your second version. The 0.2.2 release looks good, and pip should be able to pick it up correctly.

@DataGreed
Copy link
Author

Gotcha, I must have mistyped something 😓
@uranusjr @McSinyx thank you!

Closing the issue now.

Basically

python3 setup.py sdist bdist_wheel
twine upload dist/*

Does the job as expected.

@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Feb 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants