1

I am trying to use the mobilenium python package with selenium but am getting

ImportError: cannot import name 'mobidriver'

I installed using pip install mobilenium and there was no errors. My python code is as follows:

from mobilenium import mobidriver
Druta Ruslan
  • 7,171
  • 2
  • 28
  • 38
West
  • 2,350
  • 5
  • 31
  • 67

1 Answers1

1

I don't how why but after a install it with pip install mobilenium i also have an issue like you and i don't know why ?!

ImportError: cannot import name 'mobidriver'

I check it and when we install it with pip in site-packages we have a folder mobilenium with two files

site-packages/
    mobilenium/
        __init__.py # here we have copyrights
        __version__.py # here we have version of package

And it's all, with pip we don't install anything only copyrights and version

Installation

We will install it from Mobilenium github repository

Steps

# 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

That's all, no errors and mobidriver was imported. I think i help you.

Druta Ruslan
  • 7,171
  • 2
  • 28
  • 38
  • Thanks mate, import is working now. I'm just following the documentation example and for the line `mob = mobidriver.Firefox(browsermob_binary=browsermob_path)` I get an error `The Browsermob-Proxy server process failed to start` which asks me to check the the file `server.log` for more detailed info. I checked the file and it says `'java' is not recognized as an internal or external command,operable program or batch file`. Do you know a way around this? Thanks – West Jun 23 '18 at 04:19
  • 1
    try to look here, https://stackoverflow.com/questions/15796855/java-is-not-recognized-as-an-internal-or-external-command – Druta Ruslan Jun 23 '18 at 06:26
  • 1
    Great! That link helped solve the rest of the issues. Cheers! – West Jun 23 '18 at 08:37