Pypi deployment with Python 3 in an R build



I’m running an R build and manually installing python 3, since my repo requires both. I would like to include a deploy command at the end to send the built python package to pypi. Unfortunately, travis uses python2 for the deploy, which fails to build since my package is python3 only.

Is there any way to force travis not to use system python here?

My config is at



According to , pypi deployer is hard-wired to invoke python, twine and pip. So you need to override those commands. Creating symlinks in ~/bin (or whatever is early on PATH) in before_deploy: comes to mind.


Great, thanks! That looks to have done the job.


Oh, and running the build in a virtualenv (as it also overrides python and commands for installed scripts) is an all-time favorite :slight_smile: (I completely forgot about that!)