1

I had the same error as twine upload TypeError and checked my twine version to find out it's 1.10.

$ twine --version
twine version 1.10.0 (pkginfo: 1.2.1, requests: 2.18.4, setuptools:
39.2.0, requests-toolbelt: 0.8.0, tqdm: 4.19.5)

However, with pip list I find that twine is version 1.11.

$ pip list
...
twine    1.11.0
...

I tried:

$ sudo apt-get install --only-upgrade twine 

(see here)

and found that twine is already being the latest release (1.10.0-1) and could not upgrade to 1.11. twine is located here:

$ which twine
/usr/bin/twine

How can I upgrade twine?

Ollie
  • 41

1 Answers1

0

When you install the packages via apt-get, it installs whatever version was packaged. Not the latest upstream version.

To get pip's form of twine, you have to first remove twine that was installed by the repositories, and then use pip/pip3 to install.

sudo apt-get remove twine
sudo pip3 install twine

If the second command says pip3: not found then try using just pip instead of pip3.

This should then install the version from the PyPi repositories. You may have to close and reopen your terminal session to get the 'new' version of Twine picked up. (This is, assuming, that the pip version of Twine puts a binary into a location in your PATH environment variable; if it is not then this will require additional work to get working the same way as the packaged version of twine.)

Thomas Ward
  • 74,764
  • I tried your suggestion and had "Requirement already satisfied: twine in ./.local/lib/python3.6/site-packages" twine still shows when I do "pip list" outside of any virtual environments. However when I do "twine --version" I get told to install it with sudo apt install twine. Doing this again installs twine 1.10.0-1 – Ollie May 23 '18 at 20:12
  • Then Twine doesnt install a binary to the PATH when obtained from PyPI. I will have to look into this further when I get a chance, unless someone can beat me to it. – Thomas Ward May 23 '18 at 20:13