-
Notifications
You must be signed in to change notification settings - Fork 958
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
Mockserver server.py does not work in Python 3 #979
Comments
Have you tried to install simplehttpserver using pip? Maybe add the pip
install command in the docker file and rebuild the mockserver?
…On Jan 5, 2018 22:44, "systemcatch" ***@***.***> wrote:
mockserver_1 | File "../server.py", line 5, in <module>
mockserver_1 | from SimpleHTTPServer import SimpleHTTPRequestHandler, BaseHTTPServer
mockserver_1 | ModuleNotFoundError: No module named 'SimpleHTTPServer'
Looks like some modules have been reorganized in Python 3. Hopefully this
is just a matter of updating the imports.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/tmrowco/electricitymap/issues/979>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABlEKHc7BFiHVZarAF6vd-wXtBZK8mYlks5tHpfYgaJpZM4RU_AR>
.
|
Running 2to3 made just one change to server.py.
But I still get |
According to this: from http.server import SimpleHTTPRequestHandler, HTTPServer More info: Hopefully this can point you in the right direction. Unfortunately I don't have time to fix this right now but will be able to after Wednesday. |
Yeah I've been looking through those docs. I've made the following changes so that it will run on the commandline. from http.server import SimpleHTTPRequestHandler, HTTPServer, test if __name__ == '__main__':
test(CORSRequestHandler, HTTPServer) chris@ThinkPad:~/electricitymap/mockserver$ python3 server.py
Serving HTTP on 0.0.0.0 port 8000 ... But no luck getting it to work on the map yet. |
I think you need to do a |
Looks like some modules have been reorganized in Python 3. Hopefully this is just a matter of updating the imports.
The text was updated successfully, but these errors were encountered: