Does not work under Ubuntu 16.04 with Python 3.5.1
See original GitHub issueUbuntu 16.04 by default ships with Python 3.5.1 that has a typing
library that does not provide Coroutine
typing definition. This was fixed in Python 3.5.2 (python/typing#119) but afaik Ubuntu does not ship the fixed version.
Running the first example in the readme gives this output:
Traceback (most recent call last):
File "./main.py", line 15, in <module>
from aiorun import run
File "/tmp/scratch/venv/lib/python3.5/site-packages/aiorun.py", line 14, in <module>
from typing import Optional, Coroutine, Callable
ImportError: cannot import name 'Coroutine'
Im currently using this ugly hack and typing library from pip but a better solution should be figgured out.
# Ubuntu 16.04 ships with broken typing lib
# change sys path to use typing lib in virtualenv
if sys.version_info[:3] < (3, 5, 2):
old_syspath = sys.path
sys.path.insert(0, sys.path[-1])
from aiorun import run
sys.path = old_syspath
else:
from aiorun import run
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to install Python 3.5.1 on Ubuntu 16.04 LTS?
Python 3.5.1 is installed on Ubuntu 16.04 by default. You can verify that by running the command python3 --version in a terminal.
Read more >Problems after upgrading from Python 3.5 to Python 3.6 in ...
After updating binaries you should run to refresh your cache with the newest versions of your binaries (python3.6 instead of python3.5!)
Read more >How to install and switch between different python versions in ...
When I work with python, sometimes I face some issues with python versions ... and switch between different python versions in ubuntu 16.04....
Read more >Best way to run python 3.7 on Ubuntu 16.04 which comes with ...
I was able to install python3.7. only caveat is to use sudo make altinstall since the directory access was not to the normal...
Read more >OMERO 5.6.1 on Ubuntu 16.04 - issues with web and partial ...
To resolve problems 1 and 2, I found that you can install a Python 3.6 environment in Ubuntu 16.04 and modify the installation...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@artizirk The fix in #10 has now been push in
aiorun==2018.4.1
. Sorry I took so long to finalize this. Thanks again for reporting!Putting
Coroutine
import behind a version check should fix it.