Error while installing dependencies

I was trying to install the following requirements
wheel
tensorflow
transformers==2.5.1
transformers[tf-cpu]
streamlit-ace

While installing those dependencies in streamlit sharing the following error occured.

error: can't find Rust compiler
  
  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
  
  To update pip, run:
  
      pip install --upgrade pip
  
  and then retry package installation.
  
  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
  ----------------------------------------
  e[35mERRORe[0m: Failed building wheel for tokenizers
  Building wheel for pyrsistent (setup.py): started
  Building wheel for pyrsistent (setup.py): finished with status 'done'
  Created wheel for pyrsistent: filename=pyrsistent-0.17.3-cp39-cp39-linux_x86_64.whl size=72426 sha256=2fc8099de991f0d1e35e5a99f86e2336db8af0fe397d05ae04f05ad136f023b9
  Stored in directory: /tmp/pip-ephem-wheel-cache-hihn0093/wheels/00/cc/12/e712d3979a4aeee423b34a832d97c803e1a67659060315a7e0
  Building wheel for termcolor (setup.py): started
  Building wheel for termcolor (setup.py): finished with status 'done'
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4829 sha256=adaa4bc4be82285d87f8df3f5b8e38b1c81e5b5197ba7cc93d4afa16bd82d035
  Stored in directory: /tmp/pip-ephem-wheel-cache-hihn0093/wheels/b6/0d/90/0d1bbd99855f99cb2f6c2e5ff96f8023fad8ec367695f7d72d
  Building wheel for wrapt (setup.py): started
  Building wheel for wrapt (setup.py): finished with status 'done'
  Created wheel for wrapt: filename=wrapt-1.12.1-cp39-cp39-linux_x86_64.whl size=33476 sha256=0a44ba0aae8f3f8ded629dc44de02d4e223ece0f6d84a3a077ac29ff9f6837ac
  Stored in directory: /tmp/pip-ephem-wheel-cache-hihn0093/wheels/98/23/68/efe259aaca055e93b08e74fbe512819c69a2155c11ba3c0f10
  Building wheel for blinker (setup.py): started
  Building wheel for blinker (setup.py): finished with status 'done'
  Created wheel for blinker: filename=blinker-1.4-py3-none-any.whl size=13451 sha256=88f935eeced98fdcfab11204610af7e315c4ad7b4608c5c96b5fc2b298e7e8fd
  Stored in directory: /tmp/pip-ephem-wheel-cache-hihn0093/wheels/50/93/f8/4f0a42a03a06626d675f13907b6982ad5ecff383530af5a900
  Building wheel for pandocfilters (setup.py): started
  Building wheel for pandocfilters (setup.py): finished with status 'done'
  Created wheel for pandocfilters: filename=pandocfilters-1.4.3-py3-none-any.whl size=7992 sha256=f69b65c55c72a1e494616fcf23d761c1be43d11362e29e31fe626ca1402f13a2
  Stored in directory: /tmp/pip-ephem-wheel-cache-hihn0093/wheels/d7/2c/f8/55fc25b6130566bdddef382806ceaa33161b39a066c2de5912
Successfully built pyrsistent termcolor wrapt blinker pandocfilters
Failed to build tokenizers
e[35mERRORe[0m: Could not build wheels for tokenizers which use PEP 517 and cannot be installed directly
e[35mWARNINGe[0m: You are using pip version 21.0.1; however, version 21.1 is available.
You should consider upgrading via the '/home/appuser/venv/bin/python -m pip install --upgrade pip' command.
e[32m[manager] e[0minstaller returned a non-zero exit code

Hi @sowmya_lr

Was this on your personal computer or on the streamlit-sharing server?
Obvious from the error Rust is not installed, and this is needed for compiling transformers==2.5.1. See issue on github.

On your personal computer you can download and install Rust from https://www.rust-lang.org/ or try the proposed solution on github if you’re on mac/linux. I’m not sure if this is possible on the streamlit servers.

Issue is coming in streamlit sharing while installing dependencies.In my local computer I am able to work.

Then the streamlit sharing server does not support compiling packages using Rust.
You could try to compile a installation wheel locally for transformers==2.5.1, put it in you repo and refer to the local package in your requirements.txt file. I don’t know how well Rust compiles cross platform.

Perhaps the streamlit team can help with the Rust compiling on the server.

2 Likes

@sowmya_lr what’s your repo?

About rust compiler you can add a packages.txt file on your repo, with the debian package required for it, rustc, I guess.

Cheers

Hi Sowmya! :wave:

Which runtime did you use?

I had this error Could not build wheels for tokenizers which use PEP 517 with Python 3.9.

Deleting my S4 project and recreating it with Pytohn 3.7 sorted it for me.

Let me know

Thanks,
Charly