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

Failing to import clickhouse_driver: ModuleNotFoundError: 'clickhouse_driver.varint' #414

Closed
lainiwa opened this issue Feb 5, 2024 · 1 comment

Comments

@lainiwa
Copy link

lainiwa commented Feb 5, 2024

Describe the bug
ModuleNotFoundError: No module named 'clickhouse_driver.varint'

To Reproduce

  • poetry new --src my-package; cd my-package
  • Add clickhouse-driver = { git = "https://github.com/mymarilyn/clickhouse-driver.git", branch = "master" } to dependencies
  • poetry install
  • poetry run python -c "import clickhouse_driver"

Fails with

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/tmp.7AdGxEBAbU/my-package/.venv/lib/python3.11/site-packages/clickhouse_driver/__init__.py", line 2, in <module>
    from .client import Client
  File "/tmp/tmp.7AdGxEBAbU/my-package/.venv/lib/python3.11/site-packages/clickhouse_driver/client.py", line 10, in <module>
    from .block import ColumnOrientedBlock, RowOrientedBlock
  File "/tmp/tmp.7AdGxEBAbU/my-package/.venv/lib/python3.11/site-packages/clickhouse_driver/block.py", line 2, in <module>
    from .reader import read_varint, read_binary_uint8, read_binary_int32
  File "/tmp/tmp.7AdGxEBAbU/my-package/.venv/lib/python3.11/site-packages/clickhouse_driver/reader.py", line 3, in <module>
    from .varint import read_varint
ModuleNotFoundError: No module named 'clickhouse_driver.varint'

However this doesn't reproduce with clickhouse-driver = "^0.2.6" as a dependency.

Also this doesn't reproduce in a Ubuntu 22.04 container

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

while it fails on my machine (both are using python3.11):

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal

Versions

  • clickhouse_driver: Current master 24e8b35.
  • python3.11
  • poetry 1.7.1

Related #271 #137

@xzkostyan
Copy link
Member

Hi.

I suppose you need to tell poetry to build package from source as it has cython files. Something like python setup.py develop do.

I'm not familiar with poetry. May be this will help.

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

2 participants