ImportError with module pyexcel

547 Views Asked by At

I need to use module pyexcel. So I download it with pip install --index-url=https://pypi.python.org/simple/ pyexcel

I added import pyexcel to my code and try to run it, but I get this message:

/home/pem# python2 ./test1.py
Traceback (most recent call last):
  File "./test1.py", line 3, in <module>
    import pyexcel
  File "/usr/local/lib/python2.7/dist-packages/pyexcel-0.6.6-py2.7.egg/pyexcel/__init__.py", line 12, in <module>
    from .book import Book
  File "/usr/local/lib/python2.7/dist-packages/pyexcel-0.6.6-py2.7.egg/pyexcel/book.py", line 10, in <module>
    from pyexcel import _compact as compact
  File "/usr/local/lib/python2.7/dist-packages/pyexcel-0.6.6-py2.7.egg/pyexcel/_compact.py", line 21, in <module>
    from urllib import request as request
ImportError: cannot import name request

test1.py looks like:

#!/usr/bin/python2

import pyexcel

What is the problem?

1

There are 1 best solutions below

1
Sandeep Singh On

You have a python2 environment but are trying to use pyexcel which requires Python >=3.6. Create a python3.6 or greater environment and it will work fine.