Skip to content

Conversation

trp07
Copy link
Contributor

@trp07 trp07 commented Sep 6, 2019

I get an import error when trying to import werkzeug.wrappers.response but works fine with werkzeug.wrappers

I get an import error when trying to import `werkzeug.wrappers.response` but works fine with `werkzeug.wrappers`
@mikeckennedy mikeckennedy merged commit cf431da into talkpython:master Sep 7, 2019
@mikeckennedy
Copy link
Member

That's weird. It works for me. But so does your way. If it's giving you trouble, I'll go ahead and accept this. Maybe it'll help others. What error were you hitting?

@trp07
Copy link
Contributor Author

trp07 commented Sep 7, 2019

I just kept getting an import error.

>>> import werkzeug.wrappers.response
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    import werkzeug.wrappers.response
ModuleNotFoundError: No module named 'werkzeug.wrappers.response'; 'werkzeug.wrappers' is not a package

But for some reason this works fine:

>>> import werkzeug.wrappers
>>> r = werkzeug.wrappers.Response()
>>>

I wonder if this is a consequence of what Flask version I have installed. At the moment, my venv is using Flask 1.0.2.

Otherwise, this is a great course. Thanks for putting it together. I'm really enjoying it.

@mikeckennedy
Copy link
Member

mikeckennedy commented Sep 7, 2019 via email

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

Successfully merging this pull request may close these issues.

2 participants