Search code examples
pythonpipibm-cloud

Bluemix: How to upgrade pip?


I got this warning when I run my python app on bluemix:

You are using pip version 7.1.0, however version 8.1.0 is available.

How do I run shell commands like "pip install --upgrade pip" in my cf app?

Adding "Shell script" step on Build or Deploy stage gave me pip not found error.

Thanks!


Solution

  • You can't run arbitrary commands while the application is being staged, i.e. when pip would be used.

    If you can't ignore the warning, you could try the Heroku Python buildpack which is updated to use 8.1.0 by using the -b option when pushing your app, but I can't comment on how they are otherwise different.

    cf push appname -b https://github.com/heroku/heroku-buildpack-python.git

    Update: Another way is by creating your own buildpack and update manifest.yml to use this buildpack (preferably by building it up from similar buildpack if it exists). This article shows how to create a buildpack.