pinecone-io / canopy

Retrieval Augmented Generation (RAG) framework and context engine powered by Pinecone
https://www.pinecone.io/
Apache License 2.0
976 stars 121 forks source link

[Bug] Can't install Canopy SDK #328

Closed simsketch closed 8 months ago

simsketch commented 8 months ago

Is this a new bug?

Current Behavior

I can't install canopy SDK

Expected Behavior

Successful install

Steps To Reproduce

pip install canopy-sdk

Relevant log output

simsketch@Elons-MacBook-Pro rag % python --version  
Python 3.11.0
simsketch@Elons-MacBook-Pro rag % pip install canopy-sdk
Collecting canopy-sdk
  Using cached canopy_sdk-0.8.1-py3-none-any.whl.metadata (18 kB)
Collecting fastapi<1.0.0,>=0.93.0 (from canopy-sdk)
  Using cached fastapi-0.110.0-py3-none-any.whl.metadata (25 kB)
Collecting gunicorn<22.0.0,>=21.2.0 (from canopy-sdk)
  Using cached gunicorn-21.2.0-py3-none-any.whl.metadata (4.1 kB)
Collecting jsonschema<5.0.0,>=4.2.0 (from canopy-sdk)
  Using cached jsonschema-4.21.1-py3-none-any.whl.metadata (7.8 kB)
Requirement already satisfied: openai<2.0.0,>=1.2.3 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from canopy-sdk) (1.14.2)
Collecting pandas==2.0.0 (from canopy-sdk)
  Using cached pandas-2.0.0-cp312-cp312-macosx_10_9_universal2.whl
Collecting pandas-stubs<3.0.0.0,>=2.0.3.230814 (from canopy-sdk)
  Using cached pandas_stubs-2.2.1.240316-py3-none-any.whl.metadata (9.5 kB)
Collecting pinecone-client<4.0.0,>=3.0.0 (from canopy-sdk)
  Using cached pinecone_client-3.2.1-py3-none-any.whl.metadata (16 kB)
Collecting pinecone-text<0.9.0,>=0.8.0 (from canopy-sdk)
  Using cached pinecone_text-0.8.0-py3-none-any.whl.metadata (10 kB)
Collecting prompt-toolkit<4.0.0,>=3.0.39 (from canopy-sdk)
  Using cached prompt_toolkit-3.0.43-py3-none-any.whl.metadata (6.5 kB)
Collecting pyarrow<15.0.0,>=14.0.1 (from canopy-sdk)
  Using cached pyarrow-14.0.2-cp312-cp312-macosx_11_0_arm64.whl.metadata (3.0 kB)
Requirement already satisfied: pydantic<3.0.0,>=2.0.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from canopy-sdk) (2.6.4)
Collecting python-dotenv<2.0.0,>=1.0.0 (from canopy-sdk)
  Using cached python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB)
Collecting sentencepiece<0.2.0,>=0.1.99 (from canopy-sdk)
  Using cached sentencepiece-0.1.99.tar.gz (2.6 MB)
  Preparing metadata (setup.py) ... done
Collecting sse-starlette<2.0.0,>=1.6.5 (from canopy-sdk)
  Using cached sse_starlette-1.8.2-py3-none-any.whl.metadata (5.4 kB)
Collecting tenacity<9.0.0,>=8.2.1 (from canopy-sdk)
  Using cached tenacity-8.2.3-py3-none-any.whl.metadata (1.0 kB)
Collecting tiktoken<0.4.0,>=0.3.3 (from canopy-sdk)
  Using cached tiktoken-0.3.3-cp312-cp312-macosx_14_0_universal2.whl
Requirement already satisfied: tokenizers<0.16.0,>=0.15.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from canopy-sdk) (0.15.2)
Requirement already satisfied: tqdm<5.0.0,>=4.66.1 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from canopy-sdk) (4.66.2)
Collecting types-jsonschema<5.0.0,>=4.2.0 (from canopy-sdk)
  Using cached types_jsonschema-4.21.0.20240311-py3-none-any.whl.metadata (1.8 kB)
Collecting types-pyyaml<7.0.0.0,>=6.0.12.12 (from canopy-sdk)
  Using cached types_PyYAML-6.0.12.20240311-py3-none-any.whl.metadata (1.5 kB)
Collecting types-tqdm<5.0.0,>=4.61.0 (from canopy-sdk)
  Using cached types_tqdm-4.66.0.20240106-py3-none-any.whl.metadata (1.5 kB)
Collecting uvicorn<1.0.0,>=0.20.0 (from canopy-sdk)
  Using cached uvicorn-0.29.0-py3-none-any.whl.metadata (6.3 kB)
Collecting python-dateutil>=2.8.2 (from pandas==2.0.0->canopy-sdk)
  Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting pytz>=2020.1 (from pandas==2.0.0->canopy-sdk)
  Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.1 (from pandas==2.0.0->canopy-sdk)
  Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
Requirement already satisfied: numpy>=1.21.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from pandas==2.0.0->canopy-sdk) (1.26.4)
Collecting starlette<0.37.0,>=0.36.3 (from fastapi<1.0.0,>=0.93.0->canopy-sdk)
  Using cached starlette-0.36.3-py3-none-any.whl.metadata (5.9 kB)
Requirement already satisfied: typing-extensions>=4.8.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from fastapi<1.0.0,>=0.93.0->canopy-sdk) (4.10.0)
Requirement already satisfied: packaging in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from gunicorn<22.0.0,>=21.2.0->canopy-sdk) (24.0)
Collecting attrs>=22.2.0 (from jsonschema<5.0.0,>=4.2.0->canopy-sdk)
  Using cached attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
Collecting jsonschema-specifications>=2023.03.6 (from jsonschema<5.0.0,>=4.2.0->canopy-sdk)
  Using cached jsonschema_specifications-2023.12.1-py3-none-any.whl.metadata (3.0 kB)
Collecting referencing>=0.28.4 (from jsonschema<5.0.0,>=4.2.0->canopy-sdk)
  Using cached referencing-0.34.0-py3-none-any.whl.metadata (2.8 kB)
Collecting rpds-py>=0.7.1 (from jsonschema<5.0.0,>=4.2.0->canopy-sdk)
  Using cached rpds_py-0.18.0-cp312-cp312-macosx_11_0_arm64.whl.metadata (4.1 kB)
Requirement already satisfied: anyio<5,>=3.5.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from openai<2.0.0,>=1.2.3->canopy-sdk) (4.3.0)
Requirement already satisfied: distro<2,>=1.7.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from openai<2.0.0,>=1.2.3->canopy-sdk) (1.9.0)
Requirement already satisfied: httpx<1,>=0.23.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from openai<2.0.0,>=1.2.3->canopy-sdk) (0.25.2)
Requirement already satisfied: sniffio in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from openai<2.0.0,>=1.2.3->canopy-sdk) (1.3.1)
Collecting types-pytz>=2022.1.1 (from pandas-stubs<3.0.0.0,>=2.0.3.230814->canopy-sdk)
  Using cached types_pytz-2024.1.0.20240203-py3-none-any.whl.metadata (1.5 kB)
Requirement already satisfied: certifi>=2019.11.17 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from pinecone-client<4.0.0,>=3.0.0->canopy-sdk) (2024.2.2)
Requirement already satisfied: urllib3>=1.26.5 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from pinecone-client<4.0.0,>=3.0.0->canopy-sdk) (1.26.15)
Collecting mmh3<4.0.0,>=3.1.0 (from pinecone-text<0.9.0,>=0.8.0->canopy-sdk)
  Using cached mmh3-3.1.0-cp312-cp312-macosx_10_9_universal2.whl
Collecting nltk<4.0.0,>=3.6.5 (from pinecone-text<0.9.0,>=0.8.0->canopy-sdk)
  Using cached nltk-3.8.1-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: requests<3.0.0,>=2.25.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from pinecone-text<0.9.0,>=0.8.0->canopy-sdk) (2.31.0)
Collecting types-requests<3.0.0,>=2.25.0 (from pinecone-text<0.9.0,>=0.8.0->canopy-sdk)
  Using cached types_requests-2.31.0.20240311-py3-none-any.whl.metadata (1.8 kB)
Collecting wget<4.0,>=3.2 (from pinecone-text<0.9.0,>=0.8.0->canopy-sdk)
  Using cached wget-3.2-py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<4.0.0,>=3.0.39->canopy-sdk)
  Using cached wcwidth-0.2.13-py2.py3-none-any.whl.metadata (14 kB)
Requirement already satisfied: annotated-types>=0.4.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.0.0->canopy-sdk) (0.6.0)
Requirement already satisfied: pydantic-core==2.16.3 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from pydantic<3.0.0,>=2.0.0->canopy-sdk) (2.16.3)
Requirement already satisfied: regex>=2022.1.18 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from tiktoken<0.4.0,>=0.3.3->canopy-sdk) (2023.12.25)
Requirement already satisfied: huggingface_hub<1.0,>=0.16.4 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from tokenizers<0.16.0,>=0.15.0->canopy-sdk) (0.21.4)
Requirement already satisfied: click>=7.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from uvicorn<1.0.0,>=0.20.0->canopy-sdk) (8.1.7)
Requirement already satisfied: h11>=0.8 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from uvicorn<1.0.0,>=0.20.0->canopy-sdk) (0.14.0)
Requirement already satisfied: idna>=2.8 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from anyio<5,>=3.5.0->openai<2.0.0,>=1.2.3->canopy-sdk) (3.6)
Requirement already satisfied: httpcore==1.* in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from httpx<1,>=0.23.0->openai<2.0.0,>=1.2.3->canopy-sdk) (1.0.4)
Requirement already satisfied: filelock in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from huggingface_hub<1.0,>=0.16.4->tokenizers<0.16.0,>=0.15.0->canopy-sdk) (3.13.1)
Requirement already satisfied: fsspec>=2023.5.0 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from huggingface_hub<1.0,>=0.16.4->tokenizers<0.16.0,>=0.15.0->canopy-sdk) (2024.3.1)
Requirement already satisfied: pyyaml>=5.1 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from huggingface_hub<1.0,>=0.16.4->tokenizers<0.16.0,>=0.15.0->canopy-sdk) (6.0.1)
Requirement already satisfied: joblib in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from nltk<4.0.0,>=3.6.5->pinecone-text<0.9.0,>=0.8.0->canopy-sdk) (1.3.2)
Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas==2.0.0->canopy-sdk) (1.16.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages (from requests<3.0.0,>=2.25.0->pinecone-text<0.9.0,>=0.8.0->canopy-sdk) (3.3.2)
Collecting urllib3>=1.26.5 (from pinecone-client<4.0.0,>=3.0.0->canopy-sdk)
  Using cached urllib3-2.2.1-py3-none-any.whl.metadata (6.4 kB)
Using cached canopy_sdk-0.8.1-py3-none-any.whl (105 kB)
Using cached fastapi-0.110.0-py3-none-any.whl (92 kB)
Using cached gunicorn-21.2.0-py3-none-any.whl (80 kB)
Using cached jsonschema-4.21.1-py3-none-any.whl (85 kB)
Using cached pandas_stubs-2.2.1.240316-py3-none-any.whl (156 kB)
Using cached pinecone_client-3.2.1-py3-none-any.whl (213 kB)
Using cached pinecone_text-0.8.0-py3-none-any.whl (23 kB)
Using cached prompt_toolkit-3.0.43-py3-none-any.whl (386 kB)
Using cached pyarrow-14.0.2-cp312-cp312-macosx_11_0_arm64.whl (24.0 MB)
Using cached python_dotenv-1.0.1-py3-none-any.whl (19 kB)
Using cached sse_starlette-1.8.2-py3-none-any.whl (8.9 kB)
Using cached tenacity-8.2.3-py3-none-any.whl (24 kB)
Using cached types_jsonschema-4.21.0.20240311-py3-none-any.whl (10 kB)
Using cached types_PyYAML-6.0.12.20240311-py3-none-any.whl (15 kB)
Using cached types_tqdm-4.66.0.20240106-py3-none-any.whl (19 kB)
Using cached uvicorn-0.29.0-py3-none-any.whl (60 kB)
Using cached attrs-23.2.0-py3-none-any.whl (60 kB)
Using cached jsonschema_specifications-2023.12.1-py3-none-any.whl (18 kB)
Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Using cached referencing-0.34.0-py3-none-any.whl (26 kB)
Using cached rpds_py-0.18.0-cp312-cp312-macosx_11_0_arm64.whl (332 kB)
Using cached starlette-0.36.3-py3-none-any.whl (71 kB)
Using cached types_pytz-2024.1.0.20240203-py3-none-any.whl (5.1 kB)
Using cached types_requests-2.31.0.20240311-py3-none-any.whl (14 kB)
Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Using cached urllib3-2.2.1-py3-none-any.whl (121 kB)
Using cached wcwidth-0.2.13-py2.py3-none-any.whl (34 kB)
Building wheels for collected packages: sentencepiece
  Building wheel for sentencepiece (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [66 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-312
      creating build/lib.macosx-10.9-universal2-cpython-312/sentencepiece
      copying src/sentencepiece/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/sentencepiece
      copying src/sentencepiece/_version.py -> build/lib.macosx-10.9-universal2-cpython-312/sentencepiece
      copying src/sentencepiece/sentencepiece_model_pb2.py -> build/lib.macosx-10.9-universal2-cpython-312/sentencepiece
      copying src/sentencepiece/sentencepiece_pb2.py -> build/lib.macosx-10.9-universal2-cpython-312/sentencepiece
      running build_ext
      Package sentencepiece was not found in the pkg-config search path.
      Perhaps you should add the directory containing `sentencepiece.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'sentencepiece' found
      ./build_bundled.sh: line 21: cmake: command not found
      ./build_bundled.sh: line 22: nproc: command not found
      ./build_bundled.sh: line 22: cmake: command not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/k3/z0jnlt3n49s3r306n75cdnk80000gn/T/pip-install-zf4nohiy/sentencepiece_4d97de02867a4c38899f72ed1af7de7e/setup.py", line 167, in <module>
          setup(
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py", line 967, in run_command
          super().run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py", line 967, in run_command
          super().run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py", line 967, in run_command
          super().run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 91, in run
          _build_ext.run(self)
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "/private/var/folders/k3/z0jnlt3n49s3r306n75cdnk80000gn/T/pip-install-zf4nohiy/sentencepiece_4d97de02867a4c38899f72ed1af7de7e/setup.py", line 87, in build_extension
          subprocess.check_call(['./build_bundled.sh', __version__])
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['./build_bundled.sh', '0.1.99']' returned non-zero exit status 127.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for sentencepiece
  Running setup.py clean for sentencepiece
Failed to build sentencepiece
ERROR: Could not build wheels for sentencepiece, which is required to install pyproject.toml-based projects

Environment

- **OS**: Sonoma 14.4
- **Language version**: Python 3.11.0
- **Canopy version**: ?

Additional Context

No response

simsketch commented 8 months ago

I was able to solve by passing -m flag

https://github.com/pinecone-io/canopy/issues/240

https://stackoverflow.com/a/40409521/1579789

py -m pip install canopy-sdk