question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not work under Ubuntu 16.04 with Python 3.5.1

See original GitHub issue

Ubuntu 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cjrhcommented, Apr 20, 2018

@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!

0reactions
artizirkcommented, Apr 9, 2018

Putting Coroutine import behind a version check should fix it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found