Small bug in "Hello GUI" tutorial

I got an error message at command: python -m SimpleHTTPServer!
No module named SimpleHttpServer

It´s because I am using Python 3 the module “SimpleHTTPServer” has been replaced by “http.server”, at least in Windows.

The command: python -m http.server works perfectly.

Yep I believe this is the difference between python2 and python3. I will update the tutorials to reflect this.
Thanks for the find.

1 Like

Your welcome!
But anyway, I have a strange problem: I can´t access the
I started the python -m http.server 8000 in the /core_concepts/gui directory where the index.html is. The python server is running, but anyway, I can´t access the website in the browser. It looks like it´s a AV/Firewall problem.

I tried many possibilities (localhost, or my own ip), but nothing helped so far. I also tried to shut down my firewall, just for testing, but it also didn´t worked.

Sorry for asking so many questions, but I hope somebody have an idea?!

Hmm this is very strange.
You could try a different server. Any server would do. For example

I could find out now, that when I run the python server outside of nix-shell it works perfectly!

But on nix-shell, the server is running, but I can´t access localhost:8000…?

I have no idea why? Maybe it has something to do with Nix or Vagrant?
The other server, which you offered me, I couldn´t install…permissions denied! :frowning:
I will continue to try to fix…

Hm, strange. I can´t run python http.server on vagrant?! …Maybe something with my Vagrant installation went wrong?! I think I should be able to see my project files (like …/holochain/core_projects/gui/index.html) also on the synced file on my computer, right?!

When I installed Vagrant, I created a new file called /holochain-vagrant and that is my synced file, where also my Vagrantfile is!

But when I leave vagrant, I don´t find my project files in the /holochain-vagrant file?!?!

Do you know, what I made wrong or better, how can I fix it? :slight_smile:

There is actually no reason to run the python server from inside vagrant. If your having troubles with it just run it from a regular command line outside of nix-shell.

Thank you for your feedback @freesig. Well, my problem is that I can’t get a suitable synchronization between Vagrant and Host. This means the virtual /home/vagrant file synchronizes with my /Users/SvenZ/holochain-vagrant file (with the Vagrantfile) on my PC, but my virtual project file (/home/holochain/core_concepts/…) is located in a different directory on Vagrant and is therefore not synchronized. But there are my files to edit.

It looks like I made some mistakes when localizing the files or with the synchronization settings in the vagrant file?!
So if my project files in Vagrant are not synchronized or available on my host PC, can’t I use a python server on my PC? Or did I not understand something?

When I look at the tutorial, it doesn’t look like that the project file is located in the /Vagrant directory!

And the result of the compilation shows that the project files were created in /Users/username/holochain on the PC or at least synchronized to this location. With me, the files are only created in the virtual /home/holochain/ directory on Vagrant?!

What am I missing?

Hey @newprometheus the tutorials are written using linux so it might be slightly different.
Hopefully soon we will have WSL2 support and won’t need vagrant to develop on windows.

You could just move the whole holochain folder to the synced folder. Then it should show up on both.

Hey @freesig, Thank you very much for your support! Of course, you’re right. That is the obvious solution. Please forgive me, I was so busy understanding why the python server doesn’t work on nix-shell that I didn’t see the forest for the trees.
Now everything works: Vagrant synchronizes and I can edit my files on the host. :sweat_smile:

…and I can run python http.server from host.

1 Like