Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install chromadb fails with python 3.11.0 #163

Closed
jefflab opened this issue Feb 22, 2023 · 17 comments
Closed

pip install chromadb fails with python 3.11.0 #163

jefflab opened this issue Feb 22, 2023 · 17 comments

Comments

@jefflab
Copy link

jefflab commented Feb 22, 2023

steps to recreate:

  1. open shell with python 3.11.0
  2. run pip install chromadb
  3. see error "ERROR: Cannot install chromadb==0.1.0, chromadb==0.2.0, chromadb==0.3.0, chromadb==0.3.1 and chromadb==0.3.2 because these package versions have conflicting dependencies."

workarounds:

  1. downgrade python to 3.10 to match dockerfile version

full terminal output:

(chroma) jefflab@JeffsM1Air app % pip install chromadb
Collecting chromadb
  Downloading chromadb-0.3.4-py3-none-any.whl (38 kB)
Collecting pandas>=1.3
  Using cached pandas-1.5.3-cp311-cp311-macosx_11_0_arm64.whl (10.8 MB)
Collecting requests>=2.28
  Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting pydantic>=1.9
  Using cached pydantic-1.10.5-cp311-cp311-macosx_11_0_arm64.whl (2.5 MB)
Collecting hnswlib>=0.7
  Using cached hnswlib-0.7.0.tar.gz (33 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting clickhouse-connect>=0.5.7
  Using cached clickhouse_connect-0.5.12-cp311-cp311-macosx_11_0_arm64.whl (216 kB)
Collecting sentence-transformers>=2.2.2
  Using cached sentence-transformers-2.2.2.tar.gz (85 kB)
  Preparing metadata (setup.py) ... done
Collecting duckdb>=0.5.1
  Downloading duckdb-0.7.0-cp311-cp311-macosx_11_0_arm64.whl (12.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.4/12.4 MB 26.8 MB/s eta 0:00:00
Collecting fastapi>=0.85.1
  Downloading fastapi-0.92.0-py3-none-any.whl (56 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.2/56.2 kB 4.1 MB/s eta 0:00:00
Collecting uvicorn[standard]>=0.18.3
  Downloading uvicorn-0.20.0-py3-none-any.whl (56 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.9/56.9 kB 4.4 MB/s eta 0:00:00
Collecting numpy>=1.21.6
  Using cached numpy-1.24.2-cp311-cp311-macosx_11_0_arm64.whl (13.8 MB)
Collecting certifi
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 15.5 MB/s eta 0:00:00
Collecting urllib3>=1.26
  Downloading urllib3-1.26.14-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 9.5 MB/s eta 0:00:00
Collecting pytz
  Downloading pytz-2022.7.1-py2.py3-none-any.whl (499 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 kB 16.1 MB/s eta 0:00:00
Collecting zstandard
  Downloading zstandard-0.20.0-cp311-cp311-macosx_11_0_arm64.whl (355 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 356.0/356.0 kB 14.3 MB/s eta 0:00:00
Collecting lz4
  Downloading lz4-4.3.2-cp311-cp311-macosx_11_0_arm64.whl (212 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 212.3/212.3 kB 12.8 MB/s eta 0:00:00
Collecting starlette<0.26.0,>=0.25.0
  Downloading starlette-0.25.0-py3-none-any.whl (66 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.4/66.4 kB 5.8 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.1
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 11.9 MB/s eta 0:00:00
Collecting typing-extensions>=4.2.0
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.0.1-cp311-cp311-macosx_11_0_arm64.whl (121 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.1/121.1 kB 11.2 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 7.4 MB/s eta 0:00:00
Collecting transformers<5.0.0,>=4.6.0
  Downloading transformers-4.26.1-py3-none-any.whl (6.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.3/6.3 MB 25.4 MB/s eta 0:00:00
Collecting tqdm
  Downloading tqdm-4.64.1-py2.py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 5.4 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of requests to determine which version is compatible with other requirements. This could take a while.
Collecting requests>=2.28
  Downloading requests-2.28.1-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 6.1 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of pydantic to determine which version is compatible with other requirements. This could take a while.
Collecting pydantic>=1.9
  Downloading pydantic-1.10.4-cp311-cp311-macosx_11_0_arm64.whl (2.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 24.5 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of pandas to determine which version is compatible with other requirements. This could take a while.
Collecting pandas>=1.3
  Downloading pandas-1.5.2-cp311-cp311-macosx_11_0_arm64.whl (10.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.7/10.7 MB 22.7 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of numpy to determine which version is compatible with other requirements. This could take a while.
Collecting numpy>=1.21.6
  Downloading numpy-1.24.1-cp311-cp311-macosx_11_0_arm64.whl (13.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.8/13.8 MB 19.3 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of hnswlib to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of fastapi to determine which version is compatible with other requirements. This could take a while.
Collecting fastapi>=0.85.1
  Downloading fastapi-0.91.0-py3-none-any.whl (56 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.2/56.2 kB 3.7 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of duckdb to determine which version is compatible with other requirements. This could take a while.
Collecting duckdb>=0.5.1
  Downloading duckdb-0.6.1-cp311-cp311-macosx_11_0_arm64.whl (11.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.6/11.6 MB 23.3 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of clickhouse-connect to determine which version is compatible with other requirements. This could take a while.
Collecting clickhouse-connect>=0.5.7
  Downloading clickhouse_connect-0.5.11-cp311-cp311-macosx_11_0_arm64.whl (216 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 216.6/216.6 kB 10.5 MB/s eta 0:00:00
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of chromadb to determine which version is compatible with other requirements. This could take a while.
Collecting chromadb
  Downloading chromadb-0.3.3-py3-none-any.whl (38 kB)
  Downloading chromadb-0.3.2-py3-none-any.whl (37 kB)
Collecting duckdb~=0.5.1
  Using cached duckdb-0.5.1.tar.gz (13.5 MB)
  Preparing metadata (setup.py) ... done
Collecting fastapi~=0.85.1
  Using cached fastapi-0.85.2-py3-none-any.whl (55 kB)
Collecting uvicorn[standard]~=0.18.3
  Using cached uvicorn-0.18.3-py3-none-any.whl (57 kB)
Collecting chromadb
  Using cached chromadb-0.3.1-py3-none-any.whl (37 kB)
  Using cached chromadb-0.3.0-py3-none-any.whl (36 kB)
  Using cached chromadb-0.2.0-py3-none-any.whl (36 kB)
Collecting uuid~=1.30
  Using cached uuid-1.30.tar.gz (5.8 kB)
  Preparing metadata (setup.py) ... done
Collecting chromadb
  Using cached chromadb-0.1.0-py3-none-any.whl (34 kB)
ERROR: Cannot install chromadb==0.1.0, chromadb==0.2.0, chromadb==0.3.0, chromadb==0.3.1 and chromadb==0.3.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    chromadb 0.3.2 depends on numpy~=1.21.6
    chromadb 0.3.1 depends on numpy~=1.21.6
    chromadb 0.3.0 depends on numpy~=1.21.6
    chromadb 0.2.0 depends on numpy~=1.21.6
    chromadb 0.1.0 depends on numpy~=1.21.6

To fix this you could try to:
1. loosen the range of package versions you've specified
5. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
(chroma) jefflab@JeffsM1Air app % python --version
Python 3.11.0
@HammadB
Copy link
Collaborator

HammadB commented Feb 22, 2023

Thanks for filing this, I think what is occurring is that chromadb depends on sentence-transformers, which in turn depends on pytorch.

Pytorch is not yet compatible with python 3.11 pytorch/pytorch#86566. You can verify this by trying to pip install pytorch or pip install sentence-transformers

I think for now you are restricted to using <3.11 without workarounds for a few dependencies such as installing pytorch nightly, and building sentence-transformers dependency sentencepiece (google/sentencepiece#810).

@jeffchuber
Copy link
Contributor

@HammadB this intersects with the conversation we were having the other day about making the download of sentence-transformers more optional. I guess we would have to:

  1. remove it from our requirements
  2. add explicit instructions to docs to install it

Doing so would also fix the slow-start issue when it downloads all this.

I think this basically amounts to removing a default here... https://github.com/chroma-core/chroma/blob/main/chromadb/api/models/Collection.py#L40.

Or we could do "use the default if sentence-transformers is installed, otherwise error if no embedding model provided"

@jeffchuber
Copy link
Contributor

This is now tracked here: #249, so going to close this issue in favor of that.

@kotakcloud
Copy link

Works fine with: ARCHFLAGS="-arch x86_64" pip install chromadb
See if that's any useful.

Reference: Yale-LILY/SummerTime#116 (comment)

@ryanniccolls
Copy link

pip install pytorch
pip install torch
Are these two different things?

@HammadB
Copy link
Collaborator

HammadB commented Apr 24, 2023

@ryanniccolls I don't think pytorch is maintained as pypi pytorch anymore. You likely only want torch
https://pypi.org/project/torch/
https://pypi.org/project/pytorch/

@ryanniccolls
Copy link

That's. Thank you, it actually told me that I need to instal Torch.

I am using Anaconda. I am successfully asking questions of multiple PDFs. Amazing.

I think my next project is a personal AI with memory - which will be local and able to use multiple pdfs to "peer review" another PDF.

@Ninja-Ferret
Copy link

you could try 'conda install -c conda-forge chromadb' with anaconda

@jeyboy26
Copy link

Will it be upgraded to be used with 3.11??

@ashmalvayani
Copy link

SOLUTION:
ChromaDB - chroma-hnswlib build error: Microsoft Visual C++ 14.0 or greater is required
https://gist.github.com/ashmalvayani/ab3f4a8469fe3a2e9904c3a2674ea947

@JohnOstrowick
Copy link

JohnOstrowick commented Aug 28, 2023

this finally worked, apparently just use python3.10. The compile error is due to a lack of g++ or somesuch

sudo apt-get install python3-dev
python3.10 -m pip install --upgrade pip
sudo apt install build-essential
python3.10 -m pip install hnswlib
python3.10 -m pip install chromadb
after this, if you want to work with privateGPT, you need to do:
python3.10 -m pip install chroma-migrate
chroma-migrate
python3.10 -m pip install -r requirements.txt

@brunobraga
Copy link

Note this is resolved in 3.11.5. More details here: #1410 (issues with 3.12.0)

@annamalaiarunachalam
Copy link

annamalaiarunachalam commented Dec 4, 2023

this issue was raised way back in feb23. we already have python 3.12.0 we still face the same issue. each package ofcourse will depend on other packages and there will be version conflicts because different developers use different versions to develop. but this is causing too much of a hassle for someone who just wants to use a package to avail a particular feature. we cannot have 100s of environments. how do I install chromadb for python 3.12 to use langchain? please help. May I request to reopen this issue?

@RishavRanjan123
Copy link

@annamalaiarunachalam bro, i'm stuck in same issue, and thinking to delete current version and reinstall 3.11.5, tell me if u tried this. ASAP please

@RishavRanjan123
Copy link

It worked, after installing the 3.11.5 version. But, it's suggested to delete the corresponding modules and libraries simultaneously with python uninstalling, coz u'll be needing to reinstall everything after another python installation

@annamalaiarunachalam
Copy link

annamalaiarunachalam commented Dec 17, 2023 via email

@hugoblanc
Copy link

I was not able to install chromadb with python 3.11.6, it works correctly with 3.10.13 though. Didn't try with 3.11.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests