Bluemix: How to upgrade pip?

别说谁变了你拦得住时间么 提交于 2019-12-10 11:44:12

问题


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!


回答1:


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.




回答2:


PIP requires superuser permission and you can not upgrade pip with !pip install --upgrade pip command. It needs to be done at the system level and it will be done whenever the development team pushes next release of code.



来源:https://stackoverflow.com/questions/35961420/bluemix-how-to-upgrade-pip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!