abenassi / Google-Search-API

Python based api for searching google web, images, calc, and currency conversion.
552 stars 218 forks source link

Cannot install via pip or pip3 : No module named 'unidecode' #67

Open srdg opened 5 years ago

srdg commented 5 years ago

I tried to install the package via pip3 and ran into error. Printing the complete error stack below :

$ pip3 install git+https://github.com/abenassi/Google-Search-API
Collecting git+https://github.com/abenassi/Google-Search-API
  Cloning https://github.com/abenassi/Google-Search-API to /tmp/pip-b3gqvjmb-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 11, in <module>
        from setuptools.extern.six.moves import filterfalse, map
      File "/usr/lib/python3/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
        from pkg_resources.extern import VendorImporter
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
        @_call_aside
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
        f(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
        add_activation_listener(lambda dist: dist.activate())
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 956, in subscribe
        callback(dist)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in <lambda>
        add_activation_listener(lambda dist: dist.activate())
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2515, in activate
        declare_namespace(pkg)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2097, in declare_namespace
        _handle_ns(packageName, path_item)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2046, in _handle_ns
        loader.load_module(packageName)
      File "./google/__init__.py", line 2, in <module>
        from .modules import calculator, currency, images, utils
      File "./google/modules/__init__.py", line 2, in <module>
        from . import calculator
      File "./google/modules/calculator.py", line 4, in <module>
        from unidecode import unidecode
    ImportError: No module named 'unidecode'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-b3gqvjmb-build/

Any help?

MJJBennett commented 5 years ago

Also getting this error. I installed on Windows the other day with no issue and am now trying to install the package on WSL (Ubuntu). What OS were you using, @srdg ?

MJJBennett commented 5 years ago

@srdg Looks like it's some sort of issue with the requirements. You'll need to manually pip install each dependency.

srdg commented 5 years ago

@MJJBennett I am on Ubuntu Xenial 16.04 LTS. I did do pip install the dependencies manually, even a pip3 install as well (looks like they included a new dependency recently) After doing that I tried using the original command to install and errors occurred. Pasting error stacks for both commands below.

 pip install git+https://github.com/abenassi/Google-Search-API
Collecting git+https://github.com/abenassi/Google-Search-API
  Cloning https://github.com/abenassi/Google-Search-API to /tmp/pip-sblKfx-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 11, in <module>
        from setuptools.extern.six.moves import filterfalse, map
      File "/usr/lib/python2.7/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
        from pkg_resources.extern import VendorImporter
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
        @_call_aside
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
        f(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
        add_activation_listener(lambda dist: dist.activate())
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 956, in subscribe
        callback(dist)
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2952, in <lambda>
        add_activation_listener(lambda dist: dist.activate())
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2515, in activate
        declare_namespace(pkg)
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2097, in declare_namespace
        _handle_ns(packageName, path_item)
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2046, in _handle_ns
        loader.load_module(packageName)
      File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
        mod = imp.load_module(fullname, self.file, self.filename, self.etc)
      File "/tmp/pip-sblKfx-build/google/__init__.py", line 2, in <module>
        from .modules import calculator, currency, images, utils
      File "/tmp/pip-sblKfx-build/google/modules/__init__.py", line 2, in <module>
        from . import calculator
      File "/tmp/pip-sblKfx-build/google/modules/calculator.py", line 3, in <module>
        from builtins import object
    ImportError: No module named builtins
$ pip3 install git+https://github.com/abenassi/Google-Search-API
Collecting git+https://github.com/abenassi/Google-Search-API
  Cloning https://github.com/abenassi/Google-Search-API to /tmp/pip-gnygzu1b-build
    Complete output from command python setup.py egg_info:
    /usr/local/lib/python3.5/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version!
      RequestsDependencyWarning)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 11, in <module>
        from setuptools.extern.six.moves import filterfalse, map
      File "/usr/lib/python3/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
        from pkg_resources.extern import VendorImporter
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
        @_call_aside
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
        f(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
        add_activation_listener(lambda dist: dist.activate())
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 956, in subscribe
        callback(dist)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in <lambda>
        add_activation_listener(lambda dist: dist.activate())
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2515, in activate
        declare_namespace(pkg)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2097, in declare_namespace
        _handle_ns(packageName, path_item)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2047, in _handle_ns
        _rebuild_mod_path(path, packageName, module)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2066, in _rebuild_mod_path
        orig_path.sort(key=position_in_sys_path)
    AttributeError: '_NamespacePath' object has no attribute 'sort'

Also, I have selenium version 3.14.1, not sure if the error stems from that.

MJJBennett commented 5 years ago

@srdg Sorry for the late reply. Not sure if you have the library working yet, or if you went with a different workaround.

The package requirements do say that it wants a lower version of Selenium. I would recommend trying out just making a virtual environment with Python 3.6.5 and installing the requirements exactly as listed. If that doesn't work, then I'm not really sure what else could be done. If it does, then I guess it's a workaround until the package is updated for newer releases?

AmoghM commented 5 years ago

@srdg I had the same problem. This is how I circumvented it.

  1. Clone the repo
  2. Go to the cloned repo
  3. pip install -r requirements.txt
  4. pip install git+https://github.com/abenassi/Google-Search-API

It will install then.