0

I am new to TeamCity and I do not know how to install packages I have imported in my python code on the TeamCity server. For example I have imported selenium in my code and tried to install it using command line on TeamCity by pip install selenium but I got the error pip: command not found. I am not sure this is the best way to install needed packages.

4

1 回答 1

2

您似乎没有在运行 Team City 代理的机器上安装“pip”(Python 包管理器)。Team City 只会触发你的构建。在您的情况下,它可能只是解决依赖项(您的 Python 包)并运行您的代码。

所以你需要在运行 Team City 代理的机器上安装 pip。(您可能有多个代理,在所有可能构建此 python 项目的代理上安装 pip)

您可能想要升级您的 Python。Python 2.7.9 及更高版本已经带有 pip。https://www.python.org/downloads/

关于如何安装 pip 的说明。 https://pip.pypa.io/en/latest/installing.html

您可以通过 SSH 连接到该机器并运行以下 bash 脚本(假设您在 UNIX 上)。

$ curl https://bootstrap.pypa.io/get-pip.py >> get-pip.py && sudo python get-pip.py
于 2015-04-30T16:46:58.720 回答