Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use on OSX #423

Open
robvanmieghem opened this issue Aug 8, 2020 · 1 comment
Open

Unable to use on OSX #423

robvanmieghem opened this issue Aug 8, 2020 · 1 comment

Comments

@robvanmieghem
Copy link

robvanmieghem commented Aug 8, 2020

What was wrong?

import libp2p
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/rob/workspace/github.com/libp2p/py-libp2p/libp2p/__init__.py", line 3, in <module>
    from libp2p.host.basic_host import BasicHost
  File "/Users/rob/workspace/github.com/libp2p/py-libp2p/libp2p/host/basic_host.py", line 5, in <module>
    from async_service import background_trio_service
  File "/Users/rob/Library/Caches/pypoetry/virtualenvs/js-sdk-Dbu3Jec3-py3.8/lib/python3.8/site-packages/async_service/__init__.py", line 1, in <module>
    from .abc import ManagerAPI, ServiceAPI  # noqa: F401
  File "/Users/rob/Library/Caches/pypoetry/virtualenvs/js-sdk-Dbu3Jec3-py3.8/lib/python3.8/site-packages/async_service/abc.py", line 4, in <module>
    import trio_typing
  File "/Users/rob/Library/Caches/pypoetry/virtualenvs/js-sdk-Dbu3Jec3-py3.8/lib/python3.8/site-packages/trio_typing/__init__.py", line 6, in <module>
    import trio as _trio
  File "/Users/rob/Library/Caches/pypoetry/virtualenvs/js-sdk-Dbu3Jec3-py3.8/lib/python3.8/site-packages/trio/__init__.py", line 18, in <module>
    from ._core import (
  File "/Users/rob/Library/Caches/pypoetry/virtualenvs/js-sdk-Dbu3Jec3-py3.8/lib/python3.8/site-packages/trio/_core/__init__.py", line 27, in <module>
    from ._run import (
  File "/Users/rob/Library/Caches/pypoetry/virtualenvs/js-sdk-Dbu3Jec3-py3.8/lib/python3.8/site-packages/trio/_core/_run.py", line 2325, in <module>
    raise NotImplementedError("unsupported platform")
NotImplementedError: unsupported platform

Environment

macOS Catalina
python 3.8

@ShadowJonathan
Copy link
Contributor

ShadowJonathan commented Aug 10, 2020

Looks like trio doesn't run on your platform, and this snippet is causing the issue:

if sys.platform == "win32":
    from ._io_windows import WindowsIOManager as TheIOManager
    from ._generated_io_windows import *
elif sys.platform == "linux" or (not TYPE_CHECKING and hasattr(select, "epoll")):
    from ._io_epoll import EpollIOManager as TheIOManager
    from ._generated_io_epoll import *
elif TYPE_CHECKING or hasattr(select, "kqueue"):
    from ._io_kqueue import KqueueIOManager as TheIOManager
    from ._generated_io_kqueue import *
else:  # pragma: no cover
    raise NotImplementedError("unsupported platform")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants