hack のためのネタ帳, etc,,,

導入

pip3 で入れようとすると以下のように zmq が linux と誤認して linux/tipc.h を参照しようとしてエラーになる。

$ pip3 install jupyterlab

<中略>
Building wheels for collected packages: pyzmq
  Building wheel for pyzmq (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3.8.exe /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp3xpm_wsl
       cwd: /tmp/pip-install-3wslzc8y/pyzmq_511c0cf8590744f4aa9510d3bde2858a
  Complete output (189 lines):
  running bdist_wheel
  running build
  running build_py
  copying zmq/asyncio.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq
  copying zmq/decorators.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq
  copying zmq/error.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq
  copying zmq/_future.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq
  copying zmq/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/auth
  copying zmq/auth/asyncio.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/auth
  copying zmq/auth/base.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/auth
  copying zmq/auth/certs.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/auth
  copying zmq/auth/ioloop.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/auth
  copying zmq/auth/thread.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/auth
  copying zmq/auth/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/auth
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend
  copying zmq/backend/select.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend
  copying zmq/backend/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/constants.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/context.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/devices.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/error.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/message.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/socket.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/utils.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/_poll.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cffi/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/backend/cython/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/devices
  copying zmq/devices/basedevice.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/devices
  copying zmq/devices/monitoredqueue.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/devices
  copying zmq/devices/monitoredqueuedevice.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/devices
  copying zmq/devices/proxydevice.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/devices
  copying zmq/devices/proxysteerabledevice.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/devices
  copying zmq/devices/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/devices
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop
  copying zmq/eventloop/future.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop
  copying zmq/eventloop/ioloop.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop
  copying zmq/eventloop/zmqstream.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop
  copying zmq/eventloop/_deprecated.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop
  copying zmq/eventloop/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado
  copying zmq/eventloop/minitornado/concurrent.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado
  copying zmq/eventloop/minitornado/ioloop.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado
  copying zmq/eventloop/minitornado/log.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado
  copying zmq/eventloop/minitornado/stack_context.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado
  copying zmq/eventloop/minitornado/util.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado
  copying zmq/eventloop/minitornado/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado/platform
  copying zmq/eventloop/minitornado/platform/auto.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado/platform
  copying zmq/eventloop/minitornado/platform/common.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado/platform
  copying zmq/eventloop/minitornado/platform/interface.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado/platform
  copying zmq/eventloop/minitornado/platform/posix.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado/platform
  copying zmq/eventloop/minitornado/platform/windows.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado/platform
  copying zmq/eventloop/minitornado/platform/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/eventloop/minitornado/platform
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green
  copying zmq/green/core.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green
  copying zmq/green/device.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green
  copying zmq/green/poll.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green
  copying zmq/green/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green/eventloop
  copying zmq/green/eventloop/ioloop.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green/eventloop
  copying zmq/green/eventloop/zmqstream.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green/eventloop
  copying zmq/green/eventloop/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/green/eventloop
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/log
  copying zmq/log/handlers.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/log
  copying zmq/log/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/log
  copying zmq/log/__main__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/log
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/ssh
  copying zmq/ssh/forward.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/ssh
  copying zmq/ssh/tunnel.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/ssh
  copying zmq/ssh/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/ssh
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/attrsettr.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/constants.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/context.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/frame.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/poll.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/socket.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/stopwatch.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/tracker.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/version.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/conftest.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_asyncio.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_auth.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_cffi_backend.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_constants.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_context.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_cython.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_decorators.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_device.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_draft.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_error.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_etc.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_future.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_imports.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_includes.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_ioloop.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_log.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_message.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_monitor.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_monqueue.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_multipart.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_mypy.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_pair.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_poll.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_proxy_steerable.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_pubsub.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_reqrep.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_retry_eintr.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_security.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_socket.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_ssh.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_version.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_win32_shim.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_z85.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/test_zmqstream.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  copying zmq/tests/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/tests
  creating build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/constant_names.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/garbage.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/interop.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/jsonapi.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/monitor.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/strtypes.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/win32.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/z85.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/__init__.py -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/__init__.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq
  copying zmq/__init__.pyi -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq
  copying zmq/py.typed -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq
  copying zmq/backend/constants.pyi -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend
  copying zmq/backend/__init__.pyi -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend
  copying zmq/backend/cffi/_cdefs.h -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cffi
  copying zmq/backend/cython/checkrc.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/backend/cython/context.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/backend/cython/libzmq.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/backend/cython/message.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/backend/cython/socket.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/backend/cython/__init__.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/backend/cython/constants.pxi -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/backend/cython/constant_enums.pxi -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/backend/cython
  copying zmq/devices/monitoredqueue.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/devices
  copying zmq/sugar/constants.pyi -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/sugar/__init__.pyi -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/sugar
  copying zmq/utils/buffers.pxd -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/getpid_compat.h -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/ipcmaxlen.h -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/mutex.h -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/pyversion_compat.h -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/zmq_compat.h -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/zmq_constants.h -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/compiler.json -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  copying zmq/utils/config.json -> build/lib.cygwin-3.1.7-x86_64-3.8/zmq/utils
  running build_ext
  running configure
  /usr/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'cffi_modules'
    warnings.warn(msg)
  Using bundled libzmq
  already have bundled/zeromq
  already have platform.hpp
  checking for timer_create
  ************************************************
  ************************************************
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/build=/usr/src/debug/python38-3.8.7-2 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/src/Python-3.8.7=/usr/src/debug/python38-3.8.7-2 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/build=/usr/src/debug/python38-3.8.7-2 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/src/Python-3.8.7=/usr/src/debug/python38-3.8.7-2 -c /tmp/timer_createzkw3fs9z.c -o build/temp.cygwin-3.1.7-x86_64-3.8/tmp/timer_createzkw3fs9z.o
  /tmp/timer_createzkw3fs9z.c: 関数 ‘main’ 内:
  /tmp/timer_createzkw3fs9z.c:2:5: 警告: 関数 ‘timer_create’ の暗黙的な宣言です [-Wimplicit-function-declaration]
      2 |     timer_create();
        |     ^~~~~~~~~~~~
  gcc build/temp.cygwin-3.1.7-x86_64-3.8/tmp/timer_createzkw3fs9z.o -o build/temp.cygwin-3.1.7-x86_64-3.8/a.out.exe
  ok
  ************************************************
  building 'zmq.libzmq' extension
  creating build/temp.cygwin-3.1.7-x86_64-3.8/buildutils
  creating build/temp.cygwin-3.1.7-x86_64-3.8/bundled
  creating build/temp.cygwin-3.1.7-x86_64-3.8/bundled/zeromq
  creating build/temp.cygwin-3.1.7-x86_64-3.8/bundled/zeromq/src
  g++ -std=c++11 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/build=/usr/src/debug/python38-3.8.7-2 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/src/Python-3.8.7=/usr/src/debug/python38-3.8.7-2 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/build=/usr/src/debug/python38-3.8.7-2 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/src/Python-3.8.7=/usr/src/debug/python38-3.8.7-2 -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_POLL=1 -DZMQ_IOTHREADS_USE_POLL=1 -DZMQ_POLL_BASED_ON_POLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python3.8 -c buildutils/initlibzmq.cpp -o build/temp.cygwin-3.1.7-x86_64-3.8/buildutils/initlibzmq.o
  g++ -std=c++11 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/build=/usr/src/debug/python38-3.8.7-2 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/src/Python-3.8.7=/usr/src/debug/python38-3.8.7-2 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/build=/usr/src/debug/python38-3.8.7-2 -fdebug-prefix-map=/pub/devel/python/python38/python38-3.8.7-2.x86_64/src/Python-3.8.7=/usr/src/debug/python38-3.8.7-2 -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_POLL=1 -DZMQ_IOTHREADS_USE_POLL=1 -DZMQ_POLL_BASED_ON_POLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python3.8 -c bundled/zeromq/src/address.cpp -o build/temp.cygwin-3.1.7-x86_64-3.8/bundled/zeromq/src/address.o
  In file included from bundled/zeromq/src/address.cpp:38:
  bundled/zeromq/src/tipc_address.hpp:43:10: 致命的エラー: linux/tipc.h: No such file or directory
     43 | #include <linux/tipc.h>
        |          ^~~~~~~~~~~~~~
  コンパイルを停止しました。
  error: command 'g++' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyzmq
Failed to build pyzmq
ERROR: Could not build wheels for pyzmq which use PEP 517 and cannot be installed directly
これは、20190426: Cygwin - jupyter notebook で解決した通り、Cygwin の方でコンパイル済みの zmq パッケージが用意してあるので先にこれを導入しておけば OK
apt-cyg install python38-zmq
pip3 install jypyterlab

実行

軽微なエラー x2、致命的なエラー x1
軽微なのは、
  • '/usr/local/lib/python3.8/site-packages/jupyterlab/staging/yarn.js' じゃなく 'C:\usr\local\lib\python3.8\site-packages\jupyterlab\staging\yarn.js' を読もうとして読めない
  • jupyter_nbextensions_configurator モジュールが見当たらない
致命的なのは
  • <built-in function socketpair> が NULL を返したのでシステムエラー

$ jupyter-lab

Fail to get yarn configuration. node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\usr\local\lib\python3.8\site-packages\jupyterlab\staging\yarn.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

[I 2021-09-01 17:05:24.105 ServerApp] jupyterlab | extension was successfully linked.
[W 2021-09-01 17:05:24.797 ServerApp] The module 'jupyter_nbextensions_configurator' could not be found. Are you sure the extension is installed?
[I 2021-09-01 17:05:24.798 ServerApp] nbclassic | extension was successfully linked.
Traceback (most recent call last):
  File "/usr/local/bin/jupyter-lab", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 526, in launch_instance
    serverapp = cls.initialize_server(argv=args)
  File "/usr/local/lib/python3.8/site-packages/jupyter_server/extension/application.py", line 496, in initialize_server
    serverapp.initialize(
  File "/usr/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/jupyter_server/serverapp.py", line 2079, in initialize
    self.init_webapp()
  File "/usr/local/lib/python3.8/site-packages/jupyter_server/serverapp.py", line 1605, in init_webapp
    self.web_app = ServerWebApplication(
  File "/usr/local/lib/python3.8/site-packages/jupyter_server/serverapp.py", line 198, in __init__
    handlers = self.init_handlers(default_services, settings)
  File "/usr/local/lib/python3.8/site-packages/jupyter_server/serverapp.py", line 329, in init_handlers
    handlers.extend(load_handlers(loc))
  File "/usr/local/lib/python3.8/site-packages/jupyter_server/serverapp.py", line 179, in load_handlers
    mod = __import__(name, fromlist=['default_handlers'])
  File "/usr/local/lib/python3.8/site-packages/jupyter_server/services/nbconvert/handlers.py", line 10, in <module>
    LOCK = asyncio.Lock()
  File "/usr/lib/python3.8/asyncio/locks.py", line 164, in __init__
    self._loop = events.get_event_loop()
  File "/usr/lib/python3.8/asyncio/events.py", line 636, in get_event_loop
    self.set_event_loop(self.new_event_loop())
  File "/usr/lib/python3.8/asyncio/events.py", line 656, in new_event_loop
    return self._loop_factory()
  File "/usr/lib/python3.8/asyncio/unix_events.py", line 54, in __init__
    super().__init__(selector)
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 61, in __init__
    self._make_self_pipe()
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 108, in _make_self_pipe
    self._ssock, self._csock = socket.socketpair()
  File "/usr/lib/python3.8/socket.py", line 571, in socketpair
    a, b = _socket.socketpair(family, type, proto)
SystemError: <built-in function socketpair> returned NULL without setting an error
Exception ignored in: <function BaseEventLoop.__del__ at 0x6fffff722430>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/base_events.py", line 656, in __del__
    self.close()
  File "/usr/lib/python3.8/asyncio/unix_events.py", line 58, in close
    super().close()
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 92, in close
    self._close_self_pipe()
  File "/usr/lib/python3.8/asyncio/selector_events.py", line 99, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'

Cygwin socketpair returned NULL error」でググってみたらなんか Cygwin の問題っぽい

python38-3.8.7-3 で直ってそうだけど
$ apt-cyg show | grep 'python38\s'
python38                                3.8.7-2
だったので
apt-cyg dist-upgrade
して
$ apt-cyg show | grep -E 'python38\s'
python38                                3.8.10-1
に上げてみたところ、とりあえず致命的な奴だけは無事解決した。

軽微な方の1点目は、どうも jupyterlab が裏で PATH の通ってた Windows 版の node.js を呼び出してて、node.js が Cygwin の PATH 解さないので、頭に C: 付けて yarn.js 読めないってエラー吐いてる模様。
node.js への PATH 切ったら消えたが、代わりに
[W 2021-09-01 18:09:21.031 LabApp] Could not determine jupyterlab build status without nodejs
みたいな警告が出る。 見ると、(source extension 使うには) node.js が必須みたいなこと書いてあるのだが、disable にする方法が良く分からない。
--dev-mode オプションで development mode, with no extensions または --core-mode オプションで core mode, with no extensions にしてやると、Could not determine jupyterlab build status without nodejs の warning は消えるが、node.js への PATH 戻すと、yarn.js 読めないエラーは出てしまう。
あと dev-mode はなぜか 404 : Not Found に。
微妙だ。

軽微な法の2点目は、単純に
pip3 install jupyter_nbextensions_configurator
したら消えた。

あと、なぜか JupyterLab 上に表示される Python に「Python 3.6.9 64-bit」が2つ表示される。

実行してみるとどちらも 3.6.13 で何だこれって感じ。

/usr/bin 以下は、こんな感じで、
$ ls -l /usr/bin/python3* /etc/alternatives/python3 | awk '{print $9,$10,$11}'  /etc/alternatives/python3 -> /usr/bin/python3.8
/usr/bin/python3 -> /etc/alternatives/python3
/usr/bin/python3.6 -> python3.6m.exe
/usr/bin/python3.6-config -> python3.6m-config
/usr/bin/python3.6m.exe
/usr/bin/python3.6m-config
/usr/bin/python3.7 -> python3.7m.exe
/usr/bin/python3.7m.exe
/usr/bin/python3.8.exe
/usr/bin/python3.8-config
/usr/bin/python3-config -> /etc/alternatives/python3-config
3.6.13 はこれを拾ってるはずなのだが、
$ python3.6 -c 'import sys; print(sys.version)'
3.6.13 (default, May  5 2021, 13:10:10)
[GCC 10.2.0]
python3 は「Python 3 (ipykernel)」に拾われてそうだけど、python3.7, python3.8 は拾わてなさそうなのに、なぜ 3.6.13 は 2 つ拾われるのか?

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

< >

編集にはIDが必要です