numberoverzero / bottom

asyncio-based rfc2812-compliant IRC Client
http://bottom-docs.readthedocs.io
MIT License
76 stars 23 forks source link

ImportError: cannot import name 'TYPE_CHECKING' #41

Closed Nikitaw99 closed 7 years ago

Nikitaw99 commented 7 years ago
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import bottom
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\site-packages\bottom\__init__.py", line 2, in <module>
    from bottom.client import Client
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\site-packages\bottom\client.py", line 5, in <module>
    from bottom.protocol import Protocol
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\site-packages\bottom\protocol.py", line 4, in <module>
    from typing import Optional, TYPE_CHECKING
ImportError: cannot import name 'TYPE_CHECKING'

Just installed it, typed in import bottom and it just errors out.

Running on Python version 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)], and on a Windows-7-6.1.7601-SP1 machine.

numberoverzero commented 7 years ago

Thanks for the report, and sorry for the frustrating crash.

  1. Here are the 3.5 docs which suggest it exists
  2. And the corresponding source code in 3.5
  3. And a quiet note tucked away in an unrelated section that mentions 3.5.1 doesn't have TYPE_CHECKING

headdesk

$ pyenv virtualenv --copies 3.5.1 bottom-41
$ pyenv shell bottom-41
pyenv-virtualenv: activate bottom-41
$ pip install bottom
Collecting bottom
  Downloading bottom-2.0.0-py2.py3-none-any.whl
Installing collected packages: bottom
Successfully installed bottom-2.0.0
$ python
Python 3.5.1 (default, Feb  6 2016, 18:39:00) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bottom
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.pyenv/versions/bottom-41/lib/python3.5/site-packages/bottom/__init__.py", line 2, in <module>
    from bottom.client import Client
  File "/.pyenv/versions/bottom-41/lib/python3.5/site-packages/bottom/client.py", line 5, in <module>
    from bottom.protocol import Protocol
  File "/.pyenv/versions/bottom-41/lib/python3.5/site-packages/bottom/protocol.py", line 4, in <module>
    from typing import Optional, TYPE_CHECKING
ImportError: cannot import name 'TYPE_CHECKING'
>>> import typing
>>> typing.TYPE_CHECKING
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'typing' has no attribute 'TYPE_CHECKING'
>>> 

I'll add a fix and release 2.0.1 in a few minutes.

numberoverzero commented 7 years ago

Verified 2.0.1 with python 3.5.1. Sorry again for the inconvenience, and thanks very much for the report!

$ pyenv version
bottom-41 (set by PYENV_VERSION environment variable)
$ pip install -U --force-reinstall bottom
Collecting bottom
  Downloading bottom-2.0.1-py2.py3-none-any.whl
Installing collected packages: bottom
  Found existing installation: bottom 2.0.0
    Uninstalling bottom-2.0.0:
      Successfully uninstalled bottom-2.0.0
Successfully installed bottom-2.0.1
$ python
Python 3.5.1 (default, Feb  6 2016, 18:39:00) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bottom
>>> 
Nikitaw99 commented 7 years ago

Thanks for fixing it!