garrett / magicmockup

Easily create interactive mockups in Inkscape, without adding inline JS!
52 stars 7 forks source link

/usr/bin/python: No module named SimpleHTTPServer #1

Closed hbons closed 4 years ago

hbons commented 13 years ago

[hbons@myhost magicmockup]$ ./webserver.sh Visit http://localhost:8000/demo.svg /usr/bin/python: No module named SimpleHTTPServer

which deps do i need? :(

garrett commented 13 years ago

You need Python installed. I thought SimpleHTTPServer shipped with Python.

You don't actually need it for MagicMockup, however... any webserver will do. This is just to start something that should work wherever Python is installed. (It works on my Mac and on Linux w/o a problem.)

Did you compile Python yourself (without proper deps) or something? (:

hbons commented 13 years ago

I moved to Arch Linux, that's probably it... Never mind this. Could we use NodeJS or something instead? That also seems like more in the spirit of the project :)

garrett commented 13 years ago

Okay, I added support for http-server, from npm. It's basically the node equivalent. I even made both it and Python's server default to port 8000 for consistency.

  npm install http-server

I also wrote up how to use it, etc., but github failed to save my edit with a stupid error, and the text I wrote in the README is gone forever, sadly.

(It now defaults to using http-server, and then tries Python if that doesn't work.)

gonru commented 10 years ago

Try with python3 -m http.server 8000.

oswaldojr commented 9 years ago

Working! Thanks garaPM

ilovechai commented 6 years ago

If it still does not work write the following code and it should work

import SimpleHTTPServer import SocketServer PORT = 8000 Handler = SimpleHTTPServer.SimpleHTTPRequestHandler httpd = SocketServer.TCPServer(("", PORT), Handler) print "serving at port", PORT httpd.serve_forever()

donbright commented 6 years ago

yeah this is some mid 2010s stuff, doesnt work in these modern, tough times.

niranjanreddy891 commented 6 years ago

Use python -m http.server. It works for me. :) By default the port is 8000. No need to specify. If we want to run any other local host we can specify the port number at the end

aruntirath commented 5 years ago

I think you are using python3. For python3 instead of python -m SimpleHTTPServer you should use python3 -m http.server or python -m http.server

ghost commented 4 years ago

@aruntirath thx man, it's work.

garrett commented 4 years ago

I've updated the script for Python 3.

https://github.com/garrett/magicmockup/commit/be4e913b066980cc3b07cfa0a302f9728b2d46ab

We last worked on this repo around 9 years ago. I guess it's still working (aside from the Python version issue)?

garrett commented 4 years ago

I've updated the CoffeeScript to work with CoffeeScript 2 and recompiled the JS. Additionally, I've (slightly) modified the README to drop the Ruby reference and go with just NPM for installing CoffeeScript.

It's a start.

It's at https://github.com/garrett/magicmockup/pull/17 — I might get the chance to update things coming soon, but if anyone else could test out the branch and provide feedback, that would be appreciated. Perhaps we can modernize things. :wink:

savetheword commented 2 years ago

Try with python3 -m http.server 8000.

Thanks!

Bnke0x0 commented 2 years ago

use python3 -m http.server 80 or python -m http.serve 8080

HackerInfo2024 commented 1 year ago

@garaPM surprised to find this 9 years later and worked. Exactly what I was looking for.Thanks