Knowledge-Graph-Hub / kg-covid-19

An instance of KG Hub to produce a knowledge graph for COVID-19 response.
https://github.com/Knowledge-Graph-Hub/kg-covid-19/wiki
BSD 3-Clause "New" or "Revised" License
79 stars 26 forks source link

Rust/Cargo error causing ensmallen_graph package install to fail #441

Closed chuck-rosalind closed 2 years ago

chuck-rosalind commented 2 years ago

Describe the bug

I am seeing an error when trying to install the python packages. The error is causing the pip install command to fail.
Here is the error log from pip:

Collecting ensmallen_graph==0.4.3 Using cached ensmallen_graph-0.4.3.tar.gz (15 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... error ERROR: Command errored out with exit status 1: command: /Users/borromeo/git/kg-covid-19/venv/bin/python /Users/borromeo/git/kg-covid-19/venv/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /var/folders/b1/y7vjrzsj7dz9b2x042ttlv00000gn/T/tmpfu1n1q4 cwd: /private/var/folders/b1/y7vjrzsj7dz9b2x042tt_lv00000gn/T/pip-install-1cv4eni4/ensmallen-graph_61e57e012a6e48f09030c0f36c7d28dd Complete output (20 lines): ⚠️ Warning: Please use maturin in pyproject.toml with a version constraint, e.g. requires = ["maturin>=0.12,<0.13"]. This will become an error. 💥 maturin failed Caused by: Cargo metadata failed. Does your crate compile with cargo build? Caused by: cargo metadata exited with an error: Updating crates.io index error: failed to get graph as a dependency of package ensmallen_graph v0.4.3 (/private/var/folders/b1/y7vjrzsj7dz9b2x042tt_lv00000gn/T/pip-install-1cv4eni4/ensmallen-graph_61e57e012a6e48f09030c0f36c7d28dd)

Caused by:
  failed to load source for dependency `graph`

Caused by:
  Unable to update /private/var/folders/b1/y7vjrzsj7dz9b2x042tt_lv00000gn/T/graph

Caused by:
  failed to read `/private/var/folders/b1/y7vjrzsj7dz9b2x042tt_lv00000gn/T/graph/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/private/var/folders/b1/y7vjrzsj7dz9b2x042tt_lv00000gn/T/pip-modern-metadata-mrpkbpf4', '--interpreter', '/Users/borromeo/git/kg-covid-19/venv/bin/python']' returned non-zero exit status 1.
Checking for Rust toolchain....
Running `maturin pep517 write-dist-info --metadata-directory /private/var/folders/b1/y7vjrzsj7dz9b2x042tt_lv00000gn/T/pip-modern-metadata-mrpkbpf4 --interpreter /Users/borromeo/git/kg-covid-19/venv/bin/python`
----------------------------------------

To Reproduce

Follow the steps on the Quick Start page: https://knowledge-graph-hub.github.io/kg-covid-19/getting_started.html

git clone https://github.com/Knowledge-Graph-Hub/kg-covid-19 cd kg-covid-19 python3 -m venv venv && source venv/bin/activate # optional pip install .

Expected behavior

I would expect the pip install . command to pass.

Version

I am pulling from the 'master' branch. The last commit appears to be: 8779f52d7b2e6aff59a6ccc5df069ef1078e37c0. I am running python 3.8.9 on macOS Monterey (12.2.1). I have installed Rust and Cargo (cargo v. 1.58.0).

justaddcoffee commented 2 years ago

@chuck-rosalind can you tell me what OS you are using?

chuck-rosalind commented 2 years ago

@justaddcoffee I'm using macOS Monterey (12.2.1). It is running on Apple's M1 chip (if that makes a difference).

justaddcoffee commented 2 years ago

Hi @chuck-rosalind - it's possible that the issue is that ensmallen_graph doesn't support M1 chips in that version.

Could you try:

chuck-rosalind commented 2 years ago

Thanks @justaddcoffee, commenting out the line worked. So what does it mean if I removed this package? Is there some functionality that won't work? Thanks again.

justaddcoffee commented 2 years ago

No problem, glad that worked.

Basically commenting this out will break make_holdouts(), which is used to generate holdout sets for graph ML.

If you need to do this, we could probably figure out how to get ensmallen installed on your machine