我正在尝试将mobilenium
python软件包与selenium
一起使用,但是
ImportError: cannot import name 'mobidriver'
我使用pip install mobilenium
安装,没有错误。我的python代码如下:
from mobilenium import mobidriver
最佳答案
我不知道为什么,但是用pip install mobilenium
安装后,我也遇到了像您这样的问题,我也不知道为什么?!
ImportError:无法导入名称“ mobidriver”
我检查了一下,并在pip
中使用site-packages
安装它时,我们有一个包含两个文件的文件夹mobilenium
site-packages/
mobilenium/
__init__.py # here we have copyrights
__version__.py # here we have version of package
如此一来,对于
pip
,我们不会仅安装copyrights
和version
安装
我们将从Mobilenium github repository安装
脚步
# in your folder where you want to work
$ git clone https://github.com/rafpyprog/Mobilenium.git
# after this we need to install all packages from `requirements.txt`
$ pip install -r Mobilenium/requirements.txt
# create a file where you want to work and import from Mobilenium module
from Mobilenium.mobilenium import mobidriver
仅此而已,没有错误,并且导入了mobidriver。我想我帮你。
关于python - 如何将Mobilenium Python模块与Selenium一起使用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/50994565/