Search code examples
python-3.xpipsetuptools

Why did my pip download both the newest and the older version?


This is my first time to develop a PyPI package and ask a question on StackOverflow...

I'm developing a package named tttk. After I uploaded v1.0.0 and tried to install it, pip told me there's an error in setup.py. Then I changed setup.py, and rebuild, upload v1.0.1. When I try to install it again, the error appears again. I read everything in cmd, then I found that pip downloaded the package of v1.0.0 after it runs the setup.py of v1.0.1. here's the screenshot of cmd when I tried to install v1.0.1. enter image description here

I'm just trying to install tttk (the package I uploaded). Why is it soooo hard!?

I retried like this:pip install -v -v -v tttk...

here's everything I found that might be useful:

Skipping link: not a file: https://pypi.org/simple/tkinter/
Given no hashes to check 0 links for project 'tkinter': discarding no candidates
  Created temporary directory: C:\Users\Len\AppData\Local\Temp\pip-unpack-sdbco3t1
  Looking up "https://files.pythonhosted.org/packages/78/e2/748aaa5d447f3ff3b0e997cbafd8b0f8cead796b059b92514c83d6411f07/tttk-1.0.0.tar.gz" in the cache
  Current age based on date: 4074
  Ignoring unknown cache-control directive: immutable
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 4074
  Using cached tttk-1.0.0.tar.gz (16 kB)
  Added tttk from https://files.pythonhosted.org/packages/78/e2/748aaa5d447f3ff3b0e997cbafd8b0f8cead796b059b92514c83d6411f07/tttk-1.0.0.tar.gz to build tracker 'C:\\Users\\Len\\AppData\\Local\\Temp\\pip-build-tracker-6md7cbrk'
  Running setup.py (path:C:\Users\Len\AppData\Local\Temp\pip-install-7f41cz28\tttk_c1fc2afbed064900bbc613a248233cca\setup.py) egg_info for package tttk
  Created temporary directory: C:\Users\Len\AppData\Local\Temp\pip-pip-egg-info-3e78aanv
  Running command python setup.py egg_info
  Traceback (most recent call last):
    File "<string>", line 36, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\Len\AppData\Local\Temp\pip-install-7f41cz28\tttk_c1fc2afbed064900bbc613a248233cca\setup.py", line 4, in <module>
      with open("./README.md", "r",encoding='utf-8') as fh:
  FileNotFoundError: [Errno 2] No such file or directory: './README.md'
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'D:\Python37\python.exe' -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py

...

Solution

  • SOLVED

    First, thanks to every reply...

    I'm not an English speaker, and I wrote this without any help from translation software, so if you can't understand what I'm talking about, just read the last paragraph to find out the main reason and how did it caused the problem...

    Maybe I forgot to write this in my question. In fact, I have already fixed the README.MD not found problem in v1.0.1 (and newer), but v1.0.0 still has this bug. pip downloaded both v1.0.1 and 1.0.0 so this error appears again.

    The output in my question is just a part of all of them...

    I went to pypi.org and yank every older versions (v1.0.0 and v0.1.0), then retried, and seems pip couldn't find tkinter. And here's what I've got: screenshot again

    The main reason of this problem is I wrote tkinter in requirements.txt (remember this is my first time to develop a PyPI package). pip couldn't found tkinter on its server ,so it tried to install the older version automatically. But the README file not found problem is still exists in the older version, so that's why it failed...