Unable to install Transformers
Author: ghost
Pull request: no

Hi all - I'm unable to install transformers from source. I need this for a project, it's really annoying not be able to use your amazing work. Could you please help me? :) Thank you so much.

**Issue**
pip install is blocked at **sentencepiece-0.1.91** install and crashes

**What I tried**
- I tried to find a workaround by installing the latest version of sentencepiece 0.1.94 but it doesn't solve the issue
- I tried to download the repository locally and change the version requirement in setup.py and requirement.txt it doesn't solve neither
- My system: MacOS 10.15.7 / Python 3.9.0 / Pip 20.2.4 / Anaconda3 with PyTorch

**The error messages and pip list to show you I installed latest sentencepiece**

```
(env) (base) Cecilias-MacBook-Air:transformers mymacos$ pip3 install -e .
Obtaining file:///Users/mymacos/Documents/OpenAI/transformers
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting filelock
  Using cached filelock-3.0.12-py3-none-any.whl (7.6 kB)
Collecting sentencepiece==0.1.91
  Using cached sentencepiece-0.1.91.tar.gz (500 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/mymacos/Documents/OpenAI/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/s7/73dlmpfj3253cpbpl6v96rbm0000gn/T/pip-install-5ceji0j1/sentencepiece/setup.py'"'"'; __file__='"'"'/private/var/folders/s7/73dlmpfj3253cpbpl6v96rbm0000gn/T/pip-install-5ceji0j1/sentencepiece/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/s7/73dlmpfj3253cpbpl6v96rbm0000gn/T/pip-pip-egg-info-svt86xy8
         cwd: /private/var/folders/s7/73dlmpfj3253cpbpl6v96rbm0000gn/T/pip-install-5ceji0j1/sentencepiece/
    Complete output (5 lines):
    Package sentencepiece was not found in the pkg-config search path.
    Perhaps you should add the directory containing `sentencepiece.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'sentencepiece' found
    Failed to find sentencepiece pkgconfig
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

(env) (base) Cecilias-MacBook-Air:transformers mymacos$ pip list
Package           Version
----------------- -------
astroid           2.4.2
isort             5.6.4
lazy-object-proxy 1.4.3
mccabe            0.6.1
numpy             1.19.4
pip               20.2.4
pylint            2.6.0
PyYAML            5.3.1
**sentencepiece     0.1.94**
setuptools        50.3.2
six               1.15.0
toml              0.10.2
wheel             0.35.1
wrapt             1.12.1
```

Comments:
I guess the issue is that you're using `anaconda` here. Until version v4.0.0, we're not entirely compatible with anaconda as SentencePiece is not on a conda channel.

In the meantime, we recommend installing `transformers` in a pip virtual env:

```shell-script
python -m venv .env
source .env/bin/activate
pip install -e .
```

@LysandreJik Thanks for your answer! Actually it was not an `anaconda` issue.

I found the solution! There're 2 version issues in the install requirements. 
See below the steps - but I had to reinstall Python back to 3.8 as Torch/TorchVision don't support 3.9 yet.

1. Copy content of GitHub repo in a “transformers” folder: https://github.com/huggingface/transformers

2. `cd transformers`

3. Change all the `tokenizers` 0.9.3 reference to 0.9.4 in transformers files

4. Change all the `sentencepiece` 0.1.91 reference to 0.1.94 in transformers files

5. `brew install pkgconfig`

6. `python3.8 setup.py install`

And voila! I hope it helps lots of folks struggling. 👍 



@MoonshotQuest  - what are "transformers files" in the reply above?