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

0.20.0rc1 can't pip install on WSL without GCC #3433

Closed
joshpeng opened this issue Jun 5, 2021 · 4 comments
Closed

0.20.0rc1 can't pip install on WSL without GCC #3433

joshpeng opened this issue Jun 5, 2021 · 4 comments
Labels
bug Something isn't working install

Comments

@joshpeng
Copy link

joshpeng commented Jun 5, 2021

Describe the bug

When using Windows Subsystem for Linux, the latest 0.20.0rc1 release can't install into a new Python environment due to the tree-sitter package which seems to require GCC. This was not a requirement for 0.19.1 or 0.20.0b1.

Steps To Reproduce

conda create -n dbt_020rc1 python=3.8
conda activate dbt_020rc1
pip install dbt-bigquery==0.20.0rc1

It errors out with

  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for tree-sitter
Failed to build tree-sitter
ERROR: Could not build wheels for tree-sitter which use PEP 517 and cannot be installed directly

Expected behavior

Would have expected this to work without GCC like in 0.19.1 and 0.20.0b1. Installing GCC via sudo apt install gcc makes it work again though. Perhaps just adding this tidbit of info in an upgrade guide would suffice.

@joshpeng joshpeng added bug Something isn't working triage labels Jun 5, 2021
@jtcohen6 jtcohen6 added install and removed triage labels Jun 6, 2021
@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 6, 2021

Thanks for opening @joshpeng, and for your patience in getting the installation working! You're right that tree-sitter and tree-sitter-jinja2 are new dependencies in 0.20.0rc1:

https://github.com/fishtown-analytics/dbt/blob/abe8e839458d0288f76cb6950e79c77e3b1627cc/core/setup.py#L76-L77

And from the py-tree-sitter docs:

This package currently only works with Python 3. There are no library dependencies, but you do need to have a C compiler installed.

I'm inclined toward your recommendation here, in the hopes that installing GCC / a C compiler is not too heavy of a lift:

Perhaps just adding this tidbit of info in an upgrade guide would suffice.

If it proves to be a significant source of complexity, we could move tree-sitter and tree-sitter-jinja2 into an extra.

(cc @kwigley @nathaniel-may: I'd be curious to hear your thoughts)

@aa-matthias
Copy link

aa-matthias commented Jun 7, 2021

I'm having an issue installing 0.20.0rc1 on windows - also related to tree-sitter where pipenv install errors out with:

[pipenv.exceptions.InstallError]: Collecting tree-sitter==0.19.0
[pipenv.exceptions.InstallError]:   Using cached tree_sitter-0.19.0.tar.gz (112 kB)
[pipenv.exceptions.InstallError]: ERROR: Disabling PEP 517 processing is invalid: project specifies a build backend of setuptools.build_meta in pyproject.toml
ERROR: Couldn't install package: tree-sitter

the root cause for this had been that i've not installed Visual Studio 2019 Build Tools on my local machine so building tree_sitter failed. In that case pipenv tries to install a second time with --no-pep-517.

i now managed to install the build tools (2+ gb) so this comes on a heavy premium and additional steps as long as no pip wheel is provided for tree_sitter.

@kwigley
Copy link
Contributor

kwigley commented Jun 7, 2021

@joshpeng @aa-matthias thanks for calling this out. There is no way to provide wheels distribution for the 3rd party tree-sitter dependency. I think this is a good enough reason to make this dependency opt-in as an "extra" dependency as this will likely break a lot of upgrades and first-time installs.

Along with a note in docs that this method requires a C compiler, installing an extra dependency via pip will look something like:

pip install dbt[tree-sitter]

@jtcohen6
Copy link
Contributor

We ended up resolving this by rewriting the "experimental parser" (code leveraging tree-sitter) in Rust. That gets us better type checking and, crucially for this issue, the ability to package up the tree-sitter binary in our wheels.

We're going to cut 0.20.0rc2 tomorrow, and it should be installable without needing a C compiler.

In the meantime, I'm going to close this issue as having been resolved by #3497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working install
Projects
None yet
Development

No branches or pull requests

4 participants