yunabe / tslab

Interactive JavaScript and TypeScript programming with Jupyter
Apache License 2.0
737 stars 45 forks source link

Fails to install with Python 3.11 #86

Open kylebarron opened 1 year ago

kylebarron commented 1 year ago

I'm hitting this issue: https://github.com/nodejs/node-gyp/issues/2219

  File "/Users/kyle/.volta/tools/image/node/14.20.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^
  File "/Users/kyle/.volta/tools/image/node/14.20.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
           ^^^^^^^^^^^^^^
  File "/Users/kyle/.volta/tools/image/node/14.20.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 520, in gyp_main
    [generator, flat_list, targets, data] = Load(
                                            ^^^^^
  File "/Users/kyle/.volta/tools/image/node/14.20.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 136, in Load
    result = gyp.input.Load(build_files, default_variables, includes[:],
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kyle/.volta/tools/image/node/14.20.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2782, in Load
    LoadTargetBuildFile(build_file, data, aux_data,
  File "/Users/kyle/.volta/tools/image/node/14.20.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile
    build_file_data = LoadOneBuildFile(build_file_path, data, aux_data,
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kyle/.volta/tools/image/node/14.20.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 234, in LoadOneBuildFile
    build_file_contents = open(build_file_path, 'rU').read()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU' while trying to load binding.gyp

Downgrading to Python <3.11 works; it looks from the linked issue like you can probably upgrade node-gyp to fix as well?

perllaghu commented 3 months ago

If I install in a docker image based on quay.io/jupyter/base-notebook:2024-04-15, then it installs fine for me [I accept that the docker image part may be different]

That image has:

activescott commented 1 month ago

Here is what got me past gyp errors trying to add tslab to quay.io/jupyter/base-notebook:2024-04-15 in a dockerfile:

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
  && apt-get -y install --no-install-recommends build-essential cmake \
  && bash /tmp/docker-scripts/common-debian.sh