Python 3.6.4
Windows10
I am trying to load a json
file from url
However, when I try
d3.json("http://ip_addr/field/parameters", function(error, data) {
console.log(data)
}
I have an Access-Control-Allow-Origin
error.
I tried a solution
click here to see more detail
But when I typed
C:\Program Files (x86)\Google\Chrome\Application>python -m http.server 8888 &
I have error message:
Traceback (most recent call last):
File "C:\Users\xieda\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\xieda\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\xieda\AppData\Local\Programs\Python\Python36\lib\http\server.py", line 1211, in <module>
test(HandlerClass=handler_class, port=args.port, bind=args.bind)
File "C:\Users\xieda\AppData\Local\Programs\Python\Python36\lib\http\server.py", line 1185, in test
with ServerClass(server_address, HandlerClass) as httpd:
File "C:\Users\xieda\AppData\Local\Programs\Python\Python36\lib\socketserver.py", line 453, in __init__
self.server_bind()
File "C:\Users\xieda\AppData\Local\Programs\Python\Python36\lib\http\server.py", line 138, in server_bind
self.server_name = socket.getfqdn(host)
File "C:\Users\xieda\AppData\Local\Programs\Python\Python36\lib\socket.py", line 673, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 3: invalid start byte
How can I fix the problem? Or is there any solutions to my Access-Control-Allow-Origin
error?