ImportError: cannot import name 'PrintTable' in Python 3.5.1 by pyenv
Question: I installed pyenv to manage different versions of Python, and use `pip install
printtable` to download and install `printtable`.

But when I import this module in interactive shell, it doesn't work and shows
`ImportError`.

    
    
    $ pyenv versions
      system
      2.7.11
    * 3.5.1 (set by /Users/apple/.pyenv/version)
    $ pip list
      pip (8.0.0)
      printtable (1.2)
      setuptools (18.2)
    $ python
      Python 3.5.1 (default, Jan 21 2016, 12:50:43)
      [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import printtable
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/apple/.pyenv/versions/3.5.1/lib/python3.5/site-packages/printtable/__init__.py", line 1, in <module>
      from printtable import PrintTable
      ImportError: cannot import name 'PrintTable'
    

How can I manage the modules in pyenv?

PS. I'm following the book `Automate the boring stuff` step by step. The
`printtable` part is in the end of Chapter 6.

Visit: <https://automatetheboringstuff.com/chapter6/>


Answer: I downloaded _printtable_ with

    
    
    pip3 install --download /tmp printtable
    

and inspected the contentents of _printtable-1.2.tar.gz_. In
_printtable/printtable.py_ there is code like

    
    
    def  printTable(self,line_num=0):
    ....
        print self.StrTable
    

indicating that this package is not python 3 compatible.

It may be possible to install this module by

    
    
    tar xfv printtable-1.2.tar.gz
    cd printtable-1.2/
    2to3-3.5 --write printtable/*.py tests/*.py
    python3.5 setup.py build
    python3.5 setup.py install
    

