Selenium在python 2.7站点包下安装 [英] selenium getting install under python 2.7 site packages

查看:261
本文介绍了Selenium在python 2.7站点包下安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mac OSX Yosemite上,我有两个版本的python,分别是2.7和3.5,并且我有一个虚拟环境将工作区切换到3.5版本.

I have two versions of python on Mac OSX Yosemite, 2.7 and 3.5 and I have a virtual environment to switch the workspace to 3.5 version.

我将环境切换到python 3.5,然后使用"sudo pip install selenium"安装selenium webdriver软件包.它已安装,没有任何问题,但随后我尝试将其卸载,然后注意到它正在要求确认,然后我注意到显示的是python 2.7版本的路径.

I switched the environment to python 3.5 and then install the selenium webdriver package using "sudo pip install selenium". It gets installed without any issues but then I tried to uninstall it and then noticed that it is asking for confirmation and then I noticed that the path was shown for python 2.7 version.

路径是针对python 2.7的,为什么即使我在3.5版本的虚拟环境中,该软件包也还是安装在2.7中而不是3.5中?

The paths are for python 2.7, why did the package got installed in 2.7 instead of 3.5 even though I was in a virtual environment of 3.5 version?

推荐答案

您可以使用pip3代替pip,以便确保您要调用的"pip"与python3有关.

You could use pip3 instead of pip so you are sure that the 'pip' you are calling is the one related to python3.

pip3 install selenium

这篇关于Selenium在python 2.7站点包下安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆