简体   繁体   English

如何在 Windows XP 上使用 pip 安装 selenium 包?

[英]How to install selenium package using pip on Windows XP?

I am running Windows XP SP3 where I installed Python-3.4.1.我在安装 Python-3.4.1 的地方运行 Windows XP SP3。 I want to install [selenium] webdriver 2 package using pip.我想使用 pip 安装 [selenium] webdriver 2包。 I set the path variable of python in the right way on Window XP, so using CMD I run successfully python command.我在Window XP上以正确的方式设置了python的路径变量,因此使用CMD我成功运行了python命令。 However, when I run pip install selenium it says that my command is unkown.但是,当我运行 pip install selenium 时,它说我的命令未知。 From this question , I saw that PIP is embedded in Python-3.4.1.从这个问题,我看到 PIP 嵌入在 Python-3.4.1 中。

How can I install selenium package using pip (or any other means) ?如何使用 pip(或任何其他方式)安装 selenium 包? Should I declare the path variable to pip ?我应该将路径变量声明为 pip 吗? If yes, where to find pip ?如果是,在哪里可以找到 pip ?

You can find pip in: Path_to_Python_Home_Directory\\C:\\Python34\\Scripts\\pip.exe您可以在以下位置找到 pip: Path_to_Python_Home_Directory\\C:\\Python34\\Scripts\\pip.exe
Since you added a path environment variable to Python, I suppose you know how to do it for pip :)由于您向 Python 添加了路径环境变量,因此我想您知道如何为 pip 执行此操作:)
Now you can install selenium this way: Path_to_Python_Home_Directory\\C:\\Python34\\Scripts\\pip.exe install selenium , OR: pip install selenium if you set its path environment variable.现在您可以通过以下方式安装 selenium: Path_to_Python_Home_Directory\\C:\\Python34\\Scripts\\pip.exe install selenium ,或者: pip install selenium如果您设置了它的路径环境变量。

在此处输入图片说明

More details on here if you want.如果您愿意,可以在此处了解更多详细信息。

要安装 selenium,请使用此命令,包括 --User。

pip install --ignore-installed --upgrade --user selenium

You need to install pip in windows system so you can find pip.exe for that and using that you can easily install selenium您需要在 Windows 系统中安装 pip 以便您可以找到 pip.exe 并使用它您可以轻松安装 selenium

other way is to install selenium is easy_install selenium另一种方法是安装硒是easy_install selenium

we can directly use the python command with pip option to install further packages as following, without the need of setting pip in path environment:-我们可以直接使用带有 pip 选项的 python 命令来安装更多的包,如下所示,无需在路径环境中设置 pip:-

C:\\ python -m pip install python_module_name C:\\ python -m pip install python_module_name

C:\\ python -m pip install selenium C:\\ python -m pip install selenium

This will install the module using pip.这将使用 pip 安装模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM