Crissium/SilverDict

Failure to set up on Debian 12

Closed this issue · 4 comments

I tried to set up a local server on Debian 12. Steps I took:
as root
apt-get install python3-flask-cors python3-waitress python3-flask
apt-get install yarnpkg
then as user, download the zip file from github go into the unzipped directory.
cd client
yarnpkg install
yarnpkg build
mv dict ../http_server
python3.11 http_server/http_server.py
python3.11 server/server.py

then open http://localhost:8081 on web browser
Nothing shows up. On the terminal with server/server.py, nothing shows. on the http_server.py one:
127.0.0.1 - - [28/Aug/2023 03:35:28] "GET / HTTP/1.1" 200 -

Exception occurred during processing of request from ('127.0.0.1', 39100)
Traceback (most recent call last):
File "/usr/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.11/socketserver.py", line 755, in init
self.handle()
File "/usr/lib/python3.11/http/server.py", line 432, in handle
self.handle_one_request()
File "/usr/lib/python3.11/http/server.py", line 420, in handle_one_request
method()
File "/tmp/tmp/SilverDict-main/http_server/http_server.py", line 26, in do_GET
with open('dist' + path, 'rb') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'dist/index.html'

127.0.0.1 - - [28/Aug/2023 03:35:28] "GET /favicon.ico HTTP/1.1" 200 -

Exception occurred during processing of request from ('127.0.0.1', 39108)
Traceback (most recent call last):
File "/usr/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python3.11/socketserver.py", line 348, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.11/socketserver.py", line 755, in init
self.handle()
File "/usr/lib/python3.11/http/server.py", line 432, in handle
self.handle_one_request()
File "/usr/lib/python3.11/http/server.py", line 420, in handle_one_request
method()
File "/tmp/tmp/SilverDict-main/http_server/http_server.py", line 26, in do_GET
with open('dist' + path, 'rb') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'dist/favicon.ico'

Where did I get wrong in terms of following instructions? How to get it to work?

Please try running python http_server.py inside the directory /path/to/the/project/http_server. I assumed that the working directory should be that.

Yes, running the http_server.py in its own directory works! Now I have the interface showing up.

Perhaps you can update the instruction on readme.md on the main page. Currently it says
python3.10 http_server/http_server.py
python3.10 server/server.py
Which is why I didn't go into that directory.

I can see that right now it only supports mdx dictionaries. I don't have many of those and so I cannot test out whether it works with indexing and searching right now. I will contact you about DSL and stardict formats soon!

Thanks for being so responsive and helpful!

Yes, it is my fault :( I will update the instructions soon.

If you need a mdx dictionary for trying out this project, check out https://freemdict.com/.

Yes I tried one and it works on Debian! Thanks!