vmagamedov / grpclib

Pure-Python gRPC implementation for asyncio
http://grpclib.readthedocs.io
BSD 3-Clause "New" or "Revised" License
936 stars 92 forks source link

No module named `pathlib` while pip install. #3

Closed denis-trofimov closed 7 years ago

denis-trofimov commented 7 years ago

Broken in python 2.7 virtualenv.

(py27) denis@ra:~/p$ python Python 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118] on linux2

(py27) denis@ra:~/p$ pip install grpclib                                    
Requirement already satisfied: grpclib in /home/denis/.virtualenvs/py27/lib/python2.7/site-packages/grpclib-0.2.0-py2.7.egg
Collecting h2 (from grpclib)
  Using cached h2-3.0.1-py2.py3-none-any.whl
Collecting async-timeout>=1.3.0 (from grpclib)
  Using cached async-timeout-1.4.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-pNkdSz/async-timeout/setup.py", line 1, in <module>
        import pathlib
    ImportError: No module named pathlib

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-pNkdSz/async-timeout/
denis-trofimov commented 7 years ago

Adding

install_requires=['pathlib', 'h2', 'async-timeout>=1.3.0', 'multidict'],

does not solve it. I install manually.

vmagamedov commented 7 years ago

Sorry for this confusion, but grpclib supports only Python >= 3.5 (intentionally) and only asyncio (currently), documented this in the README as much as I can. You can use grpcio library from Google if you have to develop with Python 2.7 support.

We are in our company using grpcio from the client-side (legacy project on Python 2.7), and going to use grpclib on the server-side (new services on Python >= 3.5).

denis-trofimov commented 7 years ago

@vmagamedov is it comment for #4 ? What it have to do with the missing pathlib? Have you tested on the Python 3.5 clean install?

vmagamedov commented 7 years ago

pathlib module is from the standard library since Python 3.4: https://docs.python.org/3/library/pathlib.html

From the traceback I can see that pathlib is used in the setup.py script of the async-timeout library, and async-timeout is also PY3-only library.

Please try to install grpclib with Python 3.5 or higher, everything should be just fine. More information about installation you can find in the README.

denis-trofimov commented 7 years ago

Thank you for cooperation.