提取后。焦油gz运行python setup install,selenium就安装在....
creating /usr/local/lib/python2.7/dist-packages/selenium-3.4.3-py2.7.egg
Extracting selenium-3.4.3-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding selenium 3.4.3 to easy-install.pth file
Installed /usr/local/lib/python2.7/dist-packages/selenium-3.4.3-py2.7.egg
.....
跑步时
^{pr2}$
它工作得很好
但是python3.6 functionalTest.py
给出,错误:ModuleNotFoundError: No module named 'selenium'
因为我无法使用python3.6在Ubuntu上成功安装selenium,如下所示$ ls setup*
setup.cfg setup.py
$ python3.6 setup install
python3.6: can't open file 'setup': [Errno 2] No such file or directory
$ python3.6 setup.py install
Traceback (most recent call last):
File "setup.py", line 22, in
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
.....
Original exception was:
Traceback (most recent call last):
File "setup.py", line 22, in
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
$
编辑:
安装setuptools后,以下是观察结果$ python3.6 setup.py install
.....
creating /usr/local/lib/python2.7/dist-packages/selenium-3.4.3-py2.7.egg
Extracting selenium-3.4.3-py2.7.egg to /usr/local/lib/python2.7/dist-packages
selenium 3.4.3 is already the active version in easy-install.pth
Installed /usr/local/lib/python2.7/dist-packages/selenium-3.4.3-py2.7.egg
Processing dependencies for selenium==3.4.3
Finished processing dependencies for selenium==3.4.3
$ cd /usr/local/lib/python
python2.7/ python3.5/ python3.6/
$
$ easy_install --version
setuptools 20.7.0 from /usr/lib/python2.7/dist-packages (Python 2.7)
$ pip --version
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)
$
问题:
如何配置python3.6来选择selenium?为什么在/usr/local/lib/python2.7中安装了selenium,尽管使用了python3.6?在