r/PyScript • u/manatlan • May 18 '22
pyscript/js refuse to load/start, in my wan
Don't know if it's due to recent changes in "/alpha/pyscript.js" ... or if it's our corporate proxy (bluecoat) which don't like urls ending with ".py" since some days...
I can't run any pyscript examples anymore ;-(
Here is the console.log of my chrome ...
Any tips to bypass this ?
loading pyscript...
pys.html:1 Access to fetch at 'https://pyscript.net/alpha/pyscript.py' from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
interpreter.ts:24 GET https://pyscript.net/alpha/pyscript.py net::ERR_FAILED 302
loadInterpreter @ interpreter.ts:24
await in loadInterpreter (async)
initialize @ pyconfig.ts:51
(anonymous) @ pyconfig.ts:130
load (async)
loadRuntimes @ pyconfig.ts:129
connectedCallback @ pyconfig.ts:113
(anonymous) @ main.ts:27
(anonymous) @ main.ts:35
utils.ts:56 Caught an error in loadPaths:
TypeError: Failed to fetch
handleFetchError @ utils.ts:56
loadInterpreter @ interpreter.ts:28
await in loadInterpreter (async)
initialize @ pyconfig.ts:51
(anonymous) @ pyconfig.ts:130
load (async)
loadRuntimes @ pyconfig.ts:129
connectedCallback @ pyconfig.ts:113
(anonymous) @ main.ts:27
(anonymous) @ main.ts:35
interpreter.ts:30 done setting up environment
pyenv.ts:10 RUNTIME READY
pyscript.ts:148 Collecting nodes to be mounted into python namespace...
interpreter.ts:36 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'install')
at loadPackage (interpreter.ts:36:24)
at loadEnv (pyenv.ts:42:19)
at PyodideRuntime.initialize (pyconfig.ts:69:19)
View all comments
Show parent comment
2
u/manatlan May 19 '22
I will not open a issue ... Because it's really a trouble from my corporate proxy ;-(
Everywhere else -> it works, as expected ...
In fact, the proxy (bluecoat) catch all urls ending by ".py", and redirect(302) to a bluecoat page asking the user if he really wants to do the GET (because py file are considered harmfull, in bluecoat ?!).
If the "pyscript.py" was named anything else, except ".py" -> it will work ...
See how it looks like in my job: https://imgur.com/a/z2sZ3mY