Arize-ai / phoenix

AI Observability & Evaluation
https://docs.arize.com/phoenix
Other
4.05k stars 299 forks source link

[BUG] Installing package in development mode #700

Closed sweenke4 closed 1 year ago

sweenke4 commented 1 year ago

Describe the bug Trying to set up development environment in MacOS. Getting an error when installing phoenix in development mode (i.e. pip install -e '.[dev])

To Reproduce Steps to reproduce the behavior: Follow steps defined in https://github.com/Arize-ai/phoenix/blob/main/DEVELOPMENT.md for "Setting Up Your macOS Development Environment"

Expected behavior Phoenix package gets installed in development mode.

Environment (please complete the following information):

Additional context

>pip install -e '.[dev]'  

Obtaining file:///Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [190 lines of output]
      INFO:hatch_jupyter_builder.utils:Running jupyter-builder
      INFO:hatch_jupyter_builder.utils:Building with hatch_jupyter_builder.npm_builder
      INFO:hatch_jupyter_builder.utils:With kwargs: {'path': 'app', 'source_dir': 'app'}
      INFO:hatch_jupyter_builder.utils:Installing build dependencies with npm.  This may take a while...
      INFO:hatch_jupyter_builder.utils:> /usr/local/bin/npm install
      npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@3. I'll try to do my best with it!
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-arm64@0.15.13 (node_modules/esbuild/node_modules/esbuild-freebsd-arm64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-arm64@0.15.13: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/android-arm@0.15.13 (node_modules/esbuild/node_modules/@esbuild/android-arm):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/android-arm@0.15.13: wanted {"os":"android","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-arm64@0.15.13 (node_modules/esbuild/node_modules/esbuild-darwin-arm64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-arm64@0.15.13: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-arm64@0.15.13 (node_modules/esbuild/node_modules/esbuild-android-arm64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-arm64@0.15.13: wanted {"os":"android","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-64@0.15.13 (node_modules/esbuild/node_modules/esbuild-freebsd-64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-64@0.15.13: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm@0.15.13 (node_modules/esbuild/node_modules/esbuild-linux-arm):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm@0.15.13: wanted {"os":"linux","arch":"arm"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-64@0.15.13 (node_modules/esbuild/node_modules/esbuild-android-64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-64@0.15.13: wanted {"os":"android","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-loong64@0.15.13 (node_modules/esbuild/node_modules/@esbuild/linux-loong64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-loong64@0.15.13: wanted {"os":"linux","arch":"loong64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-64@0.15.13 (node_modules/esbuild/node_modules/esbuild-linux-64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-64@0.15.13: wanted {"os":"linux","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-32@0.15.13 (node_modules/esbuild/node_modules/esbuild-linux-32):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-32@0.15.13: wanted {"os":"linux","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm64@0.15.13 (node_modules/esbuild/node_modules/esbuild-linux-arm64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm64@0.15.13: wanted {"os":"linux","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-mips64le@0.15.13 (node_modules/esbuild/node_modules/esbuild-linux-mips64le):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-mips64le@0.15.13: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-riscv64@0.15.13 (node_modules/esbuild/node_modules/esbuild-linux-riscv64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-riscv64@0.15.13: wanted {"os":"linux","arch":"riscv64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-ppc64le@0.15.13 (node_modules/esbuild/node_modules/esbuild-linux-ppc64le):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-ppc64le@0.15.13: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-s390x@0.15.13 (node_modules/esbuild/node_modules/esbuild-linux-s390x):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-s390x@0.15.13: wanted {"os":"linux","arch":"s390x"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-netbsd-64@0.15.13 (node_modules/esbuild/node_modules/esbuild-netbsd-64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-netbsd-64@0.15.13: wanted {"os":"netbsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-openbsd-64@0.15.13 (node_modules/esbuild/node_modules/esbuild-openbsd-64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-openbsd-64@0.15.13: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-sunos-64@0.15.13 (node_modules/esbuild/node_modules/esbuild-sunos-64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-sunos-64@0.15.13: wanted {"os":"sunos","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-64@0.15.13 (node_modules/esbuild/node_modules/esbuild-windows-64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-64@0.15.13: wanted {"os":"win32","arch":"x64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-arm64@0.15.13 (node_modules/esbuild/node_modules/esbuild-windows-arm64):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-arm64@0.15.13: wanted {"os":"win32","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
      npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-32@0.15.13 (node_modules/esbuild/node_modules/esbuild-windows-32):
      npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-32@0.15.13: wanted {"os":"win32","arch":"ia32"} (current: {"os":"darwin","arch":"x64"})
      npm WARN ts-jest@29.1.0 requires a peer of jest@^29.0.0 but none is installed. You must install peer dependencies yourself.

      audited 534 packages in 2.728s

      99 packages are looking for funding
        run `npm fund` for details

      found 0 vulnerabilities

      INFO:hatch_jupyter_builder.utils:> /usr/local/bin/npm run build

      > phoenix-ui@0.0.1 prebuild /Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app
      > rm -rf ../src/phoenix/server/static

      > phoenix-ui@0.0.1 build /Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app
      > npm run build:static & npm run build:relay && npm run build:ts

      > phoenix-ui@0.0.1 build:static /Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app
      > cp -r ./static ../src/phoenix/server

      > phoenix-ui@0.0.1 build:relay /Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app
      > relay-compiler

      [INFO] [default] compiling...
      [INFO] [default] compiled documents: 16 reader, 14 normalization, 18 operation text
      [INFO] Done.

      > phoenix-ui@0.0.1 build:ts /Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app
      > node ./esbuild.config.mjs

      ✘ [ERROR] [plugin relay] contents.replaceAll is not a function

          node_modules/esbuild/lib/main.js:1388:21:
            1388 │         let result = await callback({
                 ╵                      ^

          at file:///Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/esbuild.relay.mjs:18:29
          at async requestCallbacks.on-load (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1388:22)
          at async handleRequest (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:697:13)

        This error came from the "onLoad" callback registered here:

          node_modules/esbuild/lib/main.js:1251:20:
            1251 │       let promise = setup({
                 ╵                     ^

          at setup (file:///Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/esbuild.relay.mjs:12:11)
          at handlePlugins (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1251:21)
          at buildOrServeImpl (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:942:5)
          at Object.buildOrServe (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:750:5)
          at /Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:2085:17
          at new Promise (<anonymous>)
          at Object.build (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:2084:14)
          at Object.build (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1931:51)
          at file:///Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/esbuild.config.mjs:14:4

        The plugin "relay" was triggered by this import

          src/index.tsx:4:24:
            4 │ import { AppRoot } from "./App";
              ╵                         ~~~~~~~

      1 error
      Failed to build Error: Build failed with 1 error:
      node_modules/esbuild/lib/main.js:1388:21: ERROR: [plugin: relay] contents.replaceAll is not a function
          at failureErrorWithLog (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1566:15)
          at /Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1024:28
          at runOnEndCallbacks (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1438:61)
          at buildResponseToResult (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1022:7)
          at /Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1134:14
          at responseCallbacks.<computed> (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:671:9)
          at handleIncomingPacket (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:726:9)
          at Socket.readFromStdout (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:647:7)
          at Socket.emit (events.js:376:20)
          at addChunk (internal/streams/readable.js:309:12) {
        errors: [
          {
            detail: TypeError: contents.replaceAll is not a function
                at file:///Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/esbuild.relay.mjs:18:29
                at async requestCallbacks.on-load (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:1388:22)
                at async handleRequest (/Users/sweenke4/Library/CloudStorage/OneDrive-NovartisPharmaAG/Projects/Visualisation/phoenix/app/node_modules/esbuild/lib/main.js:697:13),
            id: '',
            location: [Object],
            notes: [Array],
            pluginName: 'relay',
            text: 'contents.replaceAll is not a function'
          }
        ],
        warnings: []
      }
      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! phoenix-ui@0.0.1 build:ts: `node ./esbuild.config.mjs`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the phoenix-ui@0.0.1 build:ts script.
      npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

      npm ERR! A complete log of this run can be found in:
      npm ERR!     /Users/sweenke4/.npm/_logs/2023-05-10T10_32_56_393Z-debug.log
      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! phoenix-ui@0.0.1 build: `npm run build:static & npm run build:relay && npm run build:ts`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the phoenix-ui@0.0.1 build script.
      npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

      npm ERR! A complete log of this run can be found in:
      npm ERR!     /Users/sweenke4/.npm/_logs/2023-05-10T10_32_56_438Z-debug.log
      Traceback (most recent call last):
        File "/Users/sweenke4/.virtualenvs/phoenix-env/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 167, in prepare_metadata_for_build_editable
          hook = backend.prepare_metadata_for_build_editable
      AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/Users/sweenke4/.virtualenvs/phoenix-env/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/sweenke4/.virtualenvs/phoenix-env/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/sweenke4/.virtualenvs/phoenix-env/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 176, in prepare_metadata_for_build_editable
          whl_basename = build_hook(metadata_directory, config_settings)
        File "/private/var/folders/yw/zfq33jrj5z762jl1nhmn5vvh0000gn/T/pip-build-env-0l70a1to/overlay/lib/python3.9/site-packages/hatchling/build.py", line 78, in build_editable
          return os.path.basename(next(builder.build(wheel_directory, ['editable'])))
        File "/private/var/folders/yw/zfq33jrj5z762jl1nhmn5vvh0000gn/T/pip-build-env-0l70a1to/overlay/lib/python3.9/site-packages/hatchling/builders/plugin/interface.py", line 150, in build
          build_hook.initialize(version, build_data)
        File "/private/var/folders/yw/zfq33jrj5z762jl1nhmn5vvh0000gn/T/pip-build-env-0l70a1to/normal/lib/python3.9/site-packages/hatch_jupyter_builder/plugin.py", line 87, in initialize
          raise e
        File "/private/var/folders/yw/zfq33jrj5z762jl1nhmn5vvh0000gn/T/pip-build-env-0l70a1to/normal/lib/python3.9/site-packages/hatch_jupyter_builder/plugin.py", line 82, in initialize
          build_func(self.target_name, version, **build_kwargs)
        File "/private/var/folders/yw/zfq33jrj5z762jl1nhmn5vvh0000gn/T/pip-build-env-0l70a1to/normal/lib/python3.9/site-packages/hatch_jupyter_builder/utils.py", line 115, in npm_builder
          run([*npm_cmd, "run", build_cmd], cwd=str(abs_path))
        File "/private/var/folders/yw/zfq33jrj5z762jl1nhmn5vvh0000gn/T/pip-build-env-0l70a1to/normal/lib/python3.9/site-packages/hatch_jupyter_builder/utils.py", line 229, in run
          return subprocess.check_call(cmd, **kwargs)
        File "/Users/sweenke4/opt/anaconda3/lib/python3.9/subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/usr/local/bin/npm', 'run', 'build']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
sweenke4 commented 1 year ago

Looks like it requires Node.js version > 15.0.0. Might be worth putting that information in to the DEVELOPMENT.md file for future users.