An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

  • logging_strict@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    15 days ago

    This is what i get when click Play button

    Traceback (most recent call last):
      File "/lib/python3.12/site-packages/micropip/_commands/install.py", line 142, in install
        await transaction.gather_requirements(requirements)
      File "/lib/python3.12/site-packages/micropip/transaction.py", line 55, in gather_requirements
        await asyncio.gather(*requirement_promises)
      File "/lib/python3.12/site-packages/micropip/transaction.py", line 62, in add_requirement
        return await self.add_requirement_inner(Requirement(req))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/lib/python3.12/site-packages/micropip/transaction.py", line 151, in add_requirement_inner
        await self._add_requirement_from_package_index(req)
      File "/lib/python3.12/site-packages/micropip/transaction.py", line 186, in _add_requirement_from_package_index
        metadata = await package_index.query_package(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/lib/python3.12/site-packages/micropip/package_index.py", line 286, in query_package
        raise ValueError(
    ValueError: Can't fetch metadata for 'memory-graph'. Please make sure you have entered a correct package name and correctly specified index_urls (if you changed them).
    Traceback (most recent call last):
      File "/lib/python3.12/site-packages/micropip/_commands/install.py", line 142, in install
        await transaction.gather_requirements(requirements)
      File "/lib/python3.12/site-packages/micropip/transaction.py", line 55, in gather_requirements
        await asyncio.gather(*requirement_promises)
      File "/lib/python3.12/site-packages/micropip/transaction.py", line 62, in add_requirement
        return await self.add_requirement_inner(Requirement(req))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/lib/python3.12/site-packages/micropip/transaction.py", line 151, in add_requirement_inner
        await self._add_requirement_from_package_index(req)
      File "/lib/python3.12/site-packages/micropip/transaction.py", line 186, in _add_requirement_from_package_index
        metadata = await package_index.query_package(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/lib/python3.12/site-packages/micropip/package_index.py", line 286, in query_package
        raise ValueError(
    ValueError: Can't fetch metadata for 'memory-graph'. Please make sure you have entered a correct package name and correctly specified index_urls (if you changed them).
    

    From console

    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015. (Reason: CORS request did not succeed). Status code: (null).
    
    None of the “sha512” hashes in the integrity attribute match the content of the subresource. The computed hash is “z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==”. memory-graph.com
    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015. (Reason: CORS request did not succeed). Status code: (null).
    
    None of the “sha512” hashes in the integrity attribute match the content of the subresource. The computed hash is “z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==”. memory-graph.com
    Content-Security-Policy: The report URI (about:blank) should be an HTTP or HTTPS URI. memory-graph.com
    Content-Security-Policy: (Report-Only policy) The page’s settings would block a worker script (worker-src) at https://memory-graph.com/py_worker.js from being executed because it violates the following directive: “worker-src 'none'” memory-graph.com
    Loading micropip, packaging pyodide.asm.js:10:95312
    Loaded micropip, packaging pyodide.asm.js:10:95608
    PythonError: pyodide.asm.js:10:52088