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

Aiohttp: ModuleNotFoundError: No module named 'http.server'; 'http' is not a package #4278

Closed
CodeM01 opened this issue Oct 26, 2019 · 3 comments
Labels
invalid This doesn't seem right question StackOverflow

Comments

@CodeM01
Copy link

CodeM01 commented Oct 26, 2019

Long story short

I have pip installed aiohttp but I cannot get it working

Expected behaviour

Not throw an error when I import it

Actual behaviour

Its's throwing this error:

Traceback (most recent call last):
File "C:\Users\PycharmProjects\Project\http.py", line 1, in
import aiohttp
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\aiohttp_init_.py", line 6, in
from .client import BaseConnector as BaseConnector
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\aiohttp\client.py", line 32, in
from . import hdrs, http, payload
File "C:\Users\AppData\Local\Programs\Python\Python37-32\lib\site-packages\aiohttp\http.py", line 1, in
import http.server
ModuleNotFoundError: No module named 'http.server'; 'http' is not a package
[Finished in 1.431s]

Steps to reproduce

Your environment

I am using the latest version of aiohttp and im on a windows operating system. I am using aiohttp for communicating with Discords server; a client

@webknjaz
Copy link
Member

It's a common beginner mistake. Rename your module from http.py to something_else.py.

@webknjaz webknjaz added invalid This doesn't seem right question StackOverflow labels Oct 26, 2019
@webknjaz
Copy link
Member

Next time, please consider posting "help" questions on Discourse (#4257), StackOverflow or mailing lists. This tracker is for bugs.

@CodeM01
Copy link
Author

CodeM01 commented Oct 26, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question StackOverflow
Projects
None yet
Development

No branches or pull requests

2 participants