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

Import error in aiohttp with yarl v1.0.0 #161

Closed
panagiks opened this issue Jan 15, 2018 · 6 comments
Closed

Import error in aiohttp with yarl v1.0.0 #161

panagiks opened this issue Jan 15, 2018 · 6 comments

Comments

@panagiks
Copy link

Hello,

with yarl v1.0.0 I get the following error when doing from aiohttp import web:

  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web.py", line 15, in <module>
    from . import (hdrs, web_exceptions, web_fileresponse, web_middlewares,
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_middlewares.py", line 5, in <module>
    from aiohttp.web_urldispatcher import SystemRoute
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_urldispatcher.py", line 21, in <module>
    from yarl import URL, unquote
ImportError: cannot import name 'unquote'

using aiohttp-2.3.7.

@panagiks
Copy link
Author

Ah sorry ... I just saw in the changelog that the drop was intentional. I'll leave the issue open just for reference. Feel free to close it if you prefer :)

@foxx
Copy link

foxx commented Jan 15, 2018

Just encountered this same problem, but it's not clear why these were dropped. Change log references #155 but doesn't explain why they were dropped.

@Carbaz
Copy link

Carbaz commented Jan 15, 2018

This private/public "collision" is a history of a year long...

aio-libs/aiohttp#1447

@oddjobz
Copy link

oddjobz commented Jan 15, 2018

Unfortunately this has broken all my builds :( .. currently I'm trying to pin multidict and yarl to previous versions, but with no success .. not sure if I'm now hitting an issue with pipenv..

$ pipenv lock
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project.
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Could not find a version that matches multidict==3.0.0,>=2.0,>=4.0.0
Tried: 1.0.0a0, 1.0.1, 1.0.2, 1.0.3, 1.1.0b1, 1.1.0b2, 1.1.0b4, 1.1.0b5, 1.1.0b6, 1.1.0b7, 1.1.0b8, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.5, 2.1.6, 2.1.6, 3.0.0, 3.0.0, 3.1.0, 3.1.0, 3.1.1, 3.1.1, 3.1.3a0, 3.1.3a0, 3.1.3, 3.1.3, 3.1.4a0, 3.1.4a1, 3.1.4a1, 3.1.4a2, 3.1.4a2, 3.1.4a3, 3.1.4a3, 3.2.0a3, 3.2.0a3, 3.2.0, 3.2.0, 3.2.1a0, 3.2.1a0, 3.3.0, 3.3.0, 3.3.1, 3.3.1, 3.3.2, 3.3.2, 4.0.0, 4.0.0
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Could not find a version that matches multidict==3.0.0,>=2.0,>=4.0.0
Tried: 1.0.0a0, 1.0.1, 1.0.2, 1.0.3, 1.1.0b1, 1.1.0b2, 1.1.0b4, 1.1.0b5, 1.1.0b6, 1.1.0b7, 1.1.0b8, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.5, 2.1.6, 2.1.6, 3.0.0, 3.0.0, 3.1.0, 3.1.0, 3.1.1, 3.1.1, 3.1.3a0, 3.1.3a0, 3.1.3, 3.1.3, 3.1.4a0, 3.1.4a1, 3.1.4a1, 3.1.4a2, 3.1.4a2, 3.1.4a3, 3.1.4a3, 3.2.0a3, 3.2.0a3, 3.2.0, 3.2.0, 3.2.1a0, 3.2.1a0, 3.3.0, 3.3.0, 3.3.1, 3.3.1, 3.3.2, 3.3.2, 4.0.0, 4.0.0

I have multidict pinned to 3.0.0 and yarl to 0.11.0 ... any ideas on how to get around this would be very welcome ... !

@oddjobz
Copy link

oddjobz commented Jan 15, 2018

Ok, scratch that, managed to fix it by pinning aiohttp to 2.3.8 and unpinning yarl and multidict ...

@asvetlov
Copy link
Member

aiohttp is fixed

clong added a commit to clong/caldera that referenced this issue Jan 16, 2018
While attempting to install Caldera, I ran into this exact issue with Aiohttp -- it appears to be a very recent change: aio-libs/yarl#161

```
  File "caldera.py", line 16, in <module>
    from app import server
  File "/home/vagrant/caldera/caldera/app/server.py", line 13, in <module>
    from aiohttp import web, WSCloseCode
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web.py", line 15, in <module>
    from . import (hdrs, web_exceptions, web_fileresponse, web_middlewares,
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_middlewares.py", line 5, in <module>
    from aiohttp.web_urldispatcher import SystemRoute
  File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_urldispatcher.py", line 20, in <module>
    from yarl import URL, unquote
```

Updating aiohttp to 2.3.8 fixed the issue for me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants