Unble to install requirements for summarization

3.8k Views Asked by At

I am following this huggingface github(https://github.com/huggingface/transformers/tree/master/examples/pytorch/summarization) for summarization but not able to install packages from requirements.

Command used:

pip install -r requirements.txt

For your information I am trying this Intel oneapi devcloud.Please find the below error.

env: ‘pkg-config’: No such file or directory
    Failed to find sentencepiece pkg-config
    ----------------------------------------
ERROR: Command "/home/uxxxxx/.conda/envs/env/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/home/uxxxx/tmp/pip-install-ld2o4xe1/sentencepiece/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /home/uxxxxx/tmp/pip-record-tl0qz8f6/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /home/uxxxxx/tmp/pip-install-ld2o4xe1/sentencepiece/

Please use "pip install --user <package>" to install user packages.
Please visit the forums at: https://software.intel.com/en-us/forums/intel-devcloud

Thanks in Advance!

3

There are 3 best solutions below

0
Abhijeet - Intel On

To make sure you can successfully run the latest versions of the example scripts, you have to install the library from source and install some example-specific requirements.

To do this, execute the following steps in a new virtual environment:

git clone https://github.com/huggingface/transformerscd transformers
pip install .

Then cd in the example folder of your choice and run

pip install -r requirements.txt
0
senarijit1618 On

Try installing pkg-config and sentencepiece separately.

sudo apt-get install pkg-config
pip3 install sentencepiece== 0.19.2

Related source: Link

Also, follow the steps which @Abhijeet has mentioned below. That's kinda obvious so not reiterating it.

1
Tomide 'Deoye On

Try installing sentencepiece through brew then pip install

brew install sentencepiece
pip3 install sentencepiece

Then install the original package you were trying to install