PyPI deploy failing on Windows: "Couldn't install pip, setuptools, twine or wheel."

I’ve noticed the last couple releases I’ve tried to make for some packages that use the “pypi” provider deployment are failing on Windows (and Windows only) with:

failed to deploy
-z was unexpected at this time.
Couldn't install pip, setuptools, twine or wheel.

This looks like it must be a flag that the deployment tools are adding. An example failing build:

Any ideas what’s going on?

I have the same issue at (also only Windows) and I doubt that the issue has to do with our environment. From the error message, I rather think that it is due to the shell in the Travis Windows environment not able to understand the if [ -z ${VIRTUAL_ENV+x} ]; construct. A rapid resolution would be more than welcome.

1 Like

What is that supposed to do?

Regardless of setups, [ -z $var ] with no quotes is definitely a bug.

According to my tests, this fixes the initially reported issue with the -z (I have another issue but I’ll ask separately.


Sorry, I misinterpreted the results and I still have the issue at despite having the edge thingy using the patched branch.

@ericzolf Your project seems to work for me: – so I couldn’t reproduce the problem with the fix.

I added tracing to the corresponding command in my branch, please try again. We should now see what’s happening there.

Sorry for the delay, the windows build is still failing but apparently not for the initial reason:

The strange thing is that I see only warnings but the deployment fails, even though it works for the Linux jobs

Is there a way to get more info about the deploy issue?

The warnings are indeed the cause. You need to place python, pip and twine on PATH.