Setelah mengekstrak .tar.gz dan berjalan python setup install
, selenium dipasang di,
....
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
.....
di mana python
python 2.7 tetapi tidak python3.6
Sedang berlari,
$ python functionalTest.py
ini bekerja dengan baik
Tapi
$ python3.6 functionalTest.py
memberi, kesalahan:
ModuleNotFoundError: No module named 'selenium'
karena saya tidak dapat menginstal selenium menggunakan python3.6 di Ubuntu, berhasil, seperti yang ditunjukkan di bawah ini,
$ 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 <module>
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
.....
Original exception was:
Traceback (most recent call last):
File "setup.py", line 22, in <module>
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
$
Setelah menginstal setuptools
, di bawah ini adalah pengamatan,
$ 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)
$
Pertanyaan:
1) Mengapa selenium, easy_install & pip diinstal /usr/local/lib/python2.7/dist-packages
? Saya membutuhkan paket-paket ini di /usr/local/lib/python3.6/dist-packages
.
2) Bagaimana cara mengkonfigurasi python3.6 untuk memilih selenium?
3) Mengapa python --version
tidak menunjukkan python 3.6 kecuali diminta secara eksplisit python3.6 --version
?
pip3 install selenium