tslab icon indicating copy to clipboard operation
tslab copied to clipboard

Fails to install with Python 3.11

Open kylebarron opened this issue 2 years ago • 2 comments

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?

kylebarron avatar Jun 29 '23 22:06 kylebarron

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:

  • Ubuntu 22:04,
  • python 3.11.8,
  • hub 4.1.5,
  • lab 4.1.6,
  • notebook 7.1.2

perllaghu avatar Aug 01 '24 09:08 perllaghu

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

activescott avatar Oct 15 '24 21:10 activescott