Pypi deployment fails with 'module' object is not callable

You are arranging for the upload logic (changes in pypi.rb between v1.8.45 and the latest v1 release as of this writing) to be run in a custom Anaconda Python environment which it wasn’t designed for. So you are the one responsible for dealing with the fallout here.

Though Travis may accept changes that would make it easier for you, at their discretion.

In particular, your environment seems to already have another version of pip and possibly other related modules that may not be compatible with those installed by the logic and/or be overriding them.


Possible solutions that I see from the top of my head:

  • uninstall conda packages that provide pip and possibly setuptools, wheel, twine from your environment before the deploy stage.
  • suggest a change that would avoid installing the aforementioned packages if they are already present in the active Python installation (i.e. the one currently assigned to `python’) unless a specific version was requested.
  • Do not use the deployment provider but install and run twine manually instead, e.g. in the after_success: phase.