简体   繁体   English

Selenium如何离线安装?

[英]How to Install Selenium Offline?

I need to install Selenium in a Windows machine that does not have connection to the internet.我需要在没有连接到互联网的 Windows 机器上安装 Selenium。 I have donwloaded the.whl distribution file from this link: https://pypi.org/project/selenium/#files and used py -m pip install selenium.whl command, but it still asked connection to the internet.我已经从此链接下载了.whl 分发文件: https://pypi.org/project/selenium/#files并使用py -m pip install selenium.whl命令,但它仍然要求连接到 Internet。 Here's the error screenshot这是错误截图

Any help would be much appreciated.任何帮助将非常感激。

This is most likely because selenium has several dependencies, one of which is trio.这很可能是因为 selenium 有几个依赖项,其中之一是 trio。 If you try to install selenium on your offline machine it will try to look for the dependencies online.如果您尝试在离线计算机上安装 selenium,它将尝试在线查找依赖项。 This the reason for you error.这是你错误的原因。

So, you have to install the dependencies as well, otherwise selenium will not work.因此,您还必须安装依赖项,否则 selenium 将无法工作。

The way to do this is described in the following post: installing python packages without internet and using source code as.tar.gz and.whl以下帖子中描述了执行此操作的方法:在没有 Internet 的情况下安装 python 包并使用源代码 as.tar.gz 和.whl

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

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