Critical Packaging Error: Wheels for ollama 0.1.8 and 0.2.1 on PyPI contain pre-0.1.8 code #272

Closed
opened 2026-02-15 16:29:26 -05:00 by yindo · 2 comments
Owner

Originally created by @kelii7 on GitHub (May 25, 2025).

1/The .whl files for ollama==0.1.8 and ollama==0.2.1 on PyPI are incorrect.
When downloaded and inspected (or installed), ollama/__init__.py is missing the version = metadata.version(name) definition.
ollama/client.py's AsyncClient class is missing the aclose method.
The content of these files matches older versions (e.g., v0.1.7 or earlier).
2/ version 0.4.8 is also affected by this packaging error. the wheel for 0.4.8 on PyPI is also missing version in ollama/__init_
.py and AsyncClient.aclose in ollama/_client.py, despite these being present in the v0.4.8 tag on GitHub.
This causes AttributeError for ollama.version and AsyncClient.aclose().
i confirmed this by manually downloading the wheels, unzipping them, and inspecting the source files directly.

Originally created by @kelii7 on GitHub (May 25, 2025). 1/The .whl files for ollama==0.1.8 and ollama==0.2.1 on PyPI are incorrect. When downloaded and inspected (or installed), ollama/__init__.py is missing the __version__ = metadata.version(__name__) definition. ollama/_client.py's AsyncClient class is missing the aclose method. The content of these files matches older versions (e.g., v0.1.7 or earlier). 2/ version 0.4.8 is also affected by this packaging error. the wheel for 0.4.8 on PyPI is also missing __version__ in ollama/__init__.py and AsyncClient.aclose in ollama/_client.py, despite these being present in the v0.4.8 tag on GitHub. This causes AttributeError for ollama.__version__ and AsyncClient.aclose(). i confirmed this by manually downloading the wheels, unzipping them, and inspecting the source files directly.
yindo closed this issue 2026-02-15 16:29:26 -05:00
Author
Owner

@ParthSareen commented on GitHub (Jun 13, 2025):

That's weird. Is there a reason you are using those versions?

@ParthSareen commented on GitHub (Jun 13, 2025): That's weird. Is there a reason you are using those versions?
Author
Owner

@mxyng commented on GitHub (Jun 13, 2025):

The contents of 0.1.8, 0.2.1, and 0.4.8 match their respective tags.

$ git checkout v0.1.8
$ sha256sum ollama/*.py
6acc0be749f96b7d487b6b27097febf66bfaa8c810f1c8a56dbe9e95d44d428d  ollama/__init__.py
b0d53e4f9b91b13f2b9c008c259af0e7e1c02d8a75ec6c0cc1c05a832de25526  ollama/_client.py
bc5fcb8ecb71daaf71186a8918f6f624bfa386e92461d317c385a52b6cf887c0  ollama/_types.py
$ wget https://files.pythonhosted.org/packages/9a/55/87a9a2db552f787b68c8bfd720371567c13512023147b166547bfe6f9331/ollama-0.1.8-py3-none-any.whl
$ mkdir -p ollama-0.1.8
$ unzip -d ollama-0.1.8 ollama-0.1.8-py3-none-any.whl
$ sha256sum ollama-0.1.8/ollama/*.py
6acc0be749f96b7d487b6b27097febf66bfaa8c810f1c8a56dbe9e95d44d428d  ollama-0.1.8/ollama/__init__.py
b0d53e4f9b91b13f2b9c008c259af0e7e1c02d8a75ec6c0cc1c05a832de25526  ollama-0.1.8/ollama/_client.py
bc5fcb8ecb71daaf71186a8918f6f624bfa386e92461d317c385a52b6cf887c0  ollama-0.1.8/ollama/_types.py
$ git checkout v0.2.1
$ sha256sum ollama/*.py
0d4093cf120e2da37556d1ff8b6cdc45618483c2e31ceddaaa6c020be6b783f2  ollama/__init__.py
6ec631ab06c94d24b3c6dc3a3242c7c86a0d10fc8275af205db482569eea5daf  ollama/_client.py
ad78c978af8118d7b0a6bb6f47b6c2ecbbb4e01b6b47fd2e22f2c41d49f52811  ollama/_types.py
$ wget https://files.pythonhosted.org/packages/7d/b7/8cc05807bfbc5b92da7fb94c525e1e56572a08eea7cdf3656e6c5dc6f9b1/ollama-0.2.1-py3-none-any.whl
$ mkdir -p ollama-0.2.1
$ unzip -d ollama-0.2.1 ollama-0.2.1-py3-none-any.whl
$ sha256sum ollama-0.2.1/ollama/*.py
0d4093cf120e2da37556d1ff8b6cdc45618483c2e31ceddaaa6c020be6b783f2  ollama-0.2.1/ollama/__init__.py
6ec631ab06c94d24b3c6dc3a3242c7c86a0d10fc8275af205db482569eea5daf  ollama-0.2.1/ollama/_client.py
ad78c978af8118d7b0a6bb6f47b6c2ecbbb4e01b6b47fd2e22f2c41d49f52811  ollama-0.2.1/ollama/_types.py
$ git checkout v0.4.8
$ sha256sum ollama/*.py
7fdbc4c59f61ed1ef6f8468cd31be330aefdbbac208896f3a3577362682944ef  ollama/__init__.py
461647048b0b9b7127e23243d08d08879b107baf8cc8b2d981f26ec99043eae0  ollama/_client.py
436fffc18c6a323e49632692d0d443f7169b4ed2719c3fdb06f4ec19284616c5  ollama/_types.py
df0000d675bc5e5e04bafa08dbdc64a5c82b614dfc5a37309ef964461a71c913  ollama/_utils.py
$ wget https://files.pythonhosted.org/packages/33/3f/164de150e983b3a16e8bf3d4355625e51a357e7b3b1deebe9cc1f7cb9af8/ollama-0.4.8-py3-none-any.whl
$ mkdir -p ollama-0.4.8
$ unzip -d ollama-0.4.8 ollama-0.4.8-py3-none-any.whl
$ sha256sum ollama-0.4.8/ollama/*.py
7fdbc4c59f61ed1ef6f8468cd31be330aefdbbac208896f3a3577362682944ef  ollama-0.4.8/ollama/__init__.py
461647048b0b9b7127e23243d08d08879b107baf8cc8b2d981f26ec99043eae0  ollama-0.4.8/ollama/_client.py
436fffc18c6a323e49632692d0d443f7169b4ed2719c3fdb06f4ec19284616c5  ollama-0.4.8/ollama/_types.py
df0000d675bc5e5e04bafa08dbdc64a5c82b614dfc5a37309ef964461a71c913  ollama-0.4.8/ollama/_utils.py

The premise ollama.__version__ and AsyncClient.aclose() is accessible is incorrect.

  1. __version__ has never been exported by the ollama package. It's only used internally to set the HTTP User Agent.
  2. AsyncClient has never implemented aclose() or __aclose__() since it's not intended to be an asynchronous context manager. There's no mention of aclose anywhere in git history so it's unclear what you mean by "despite these being present in the v0.4.8"
@mxyng commented on GitHub (Jun 13, 2025): The contents of 0.1.8, 0.2.1, and 0.4.8 match their respective tags. ```console $ git checkout v0.1.8 $ sha256sum ollama/*.py 6acc0be749f96b7d487b6b27097febf66bfaa8c810f1c8a56dbe9e95d44d428d ollama/__init__.py b0d53e4f9b91b13f2b9c008c259af0e7e1c02d8a75ec6c0cc1c05a832de25526 ollama/_client.py bc5fcb8ecb71daaf71186a8918f6f624bfa386e92461d317c385a52b6cf887c0 ollama/_types.py $ wget https://files.pythonhosted.org/packages/9a/55/87a9a2db552f787b68c8bfd720371567c13512023147b166547bfe6f9331/ollama-0.1.8-py3-none-any.whl $ mkdir -p ollama-0.1.8 $ unzip -d ollama-0.1.8 ollama-0.1.8-py3-none-any.whl $ sha256sum ollama-0.1.8/ollama/*.py 6acc0be749f96b7d487b6b27097febf66bfaa8c810f1c8a56dbe9e95d44d428d ollama-0.1.8/ollama/__init__.py b0d53e4f9b91b13f2b9c008c259af0e7e1c02d8a75ec6c0cc1c05a832de25526 ollama-0.1.8/ollama/_client.py bc5fcb8ecb71daaf71186a8918f6f624bfa386e92461d317c385a52b6cf887c0 ollama-0.1.8/ollama/_types.py ``` ```console $ git checkout v0.2.1 $ sha256sum ollama/*.py 0d4093cf120e2da37556d1ff8b6cdc45618483c2e31ceddaaa6c020be6b783f2 ollama/__init__.py 6ec631ab06c94d24b3c6dc3a3242c7c86a0d10fc8275af205db482569eea5daf ollama/_client.py ad78c978af8118d7b0a6bb6f47b6c2ecbbb4e01b6b47fd2e22f2c41d49f52811 ollama/_types.py $ wget https://files.pythonhosted.org/packages/7d/b7/8cc05807bfbc5b92da7fb94c525e1e56572a08eea7cdf3656e6c5dc6f9b1/ollama-0.2.1-py3-none-any.whl $ mkdir -p ollama-0.2.1 $ unzip -d ollama-0.2.1 ollama-0.2.1-py3-none-any.whl $ sha256sum ollama-0.2.1/ollama/*.py 0d4093cf120e2da37556d1ff8b6cdc45618483c2e31ceddaaa6c020be6b783f2 ollama-0.2.1/ollama/__init__.py 6ec631ab06c94d24b3c6dc3a3242c7c86a0d10fc8275af205db482569eea5daf ollama-0.2.1/ollama/_client.py ad78c978af8118d7b0a6bb6f47b6c2ecbbb4e01b6b47fd2e22f2c41d49f52811 ollama-0.2.1/ollama/_types.py ``` ```console $ git checkout v0.4.8 $ sha256sum ollama/*.py 7fdbc4c59f61ed1ef6f8468cd31be330aefdbbac208896f3a3577362682944ef ollama/__init__.py 461647048b0b9b7127e23243d08d08879b107baf8cc8b2d981f26ec99043eae0 ollama/_client.py 436fffc18c6a323e49632692d0d443f7169b4ed2719c3fdb06f4ec19284616c5 ollama/_types.py df0000d675bc5e5e04bafa08dbdc64a5c82b614dfc5a37309ef964461a71c913 ollama/_utils.py $ wget https://files.pythonhosted.org/packages/33/3f/164de150e983b3a16e8bf3d4355625e51a357e7b3b1deebe9cc1f7cb9af8/ollama-0.4.8-py3-none-any.whl $ mkdir -p ollama-0.4.8 $ unzip -d ollama-0.4.8 ollama-0.4.8-py3-none-any.whl $ sha256sum ollama-0.4.8/ollama/*.py 7fdbc4c59f61ed1ef6f8468cd31be330aefdbbac208896f3a3577362682944ef ollama-0.4.8/ollama/__init__.py 461647048b0b9b7127e23243d08d08879b107baf8cc8b2d981f26ec99043eae0 ollama-0.4.8/ollama/_client.py 436fffc18c6a323e49632692d0d443f7169b4ed2719c3fdb06f4ec19284616c5 ollama-0.4.8/ollama/_types.py df0000d675bc5e5e04bafa08dbdc64a5c82b614dfc5a37309ef964461a71c913 ollama-0.4.8/ollama/_utils.py ``` The premise `ollama.__version__` and `AsyncClient.aclose()` is accessible is incorrect. 1. `__version__` has never been exported by the ollama package. It's only used internally to set the HTTP User Agent. 2. `AsyncClient` has never implemented `aclose()` or `__aclose__()` since it's not intended to be an asynchronous context manager. There's no mention of `aclose` anywhere in git history so it's unclear what you mean by "despite these being present in the v0.4.8"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#272