Purpose – I am trying to install Llama3 by first installing Transformers
Dependency is RUST and while installing Rust into a Virtual Environment I get a SUbprocess error during the – “pip install rust” command
i get a file not found error –
Expecting RUST To be a clean install but I get the following error
> Using cached RUST-1.3.1-py3-none-any.whl.metadata (762 bytes)
> Collecting pysam (from rust)
> Using cached pysam-0.22.1.tar.gz (4.6 MB)
> Installing build dependencies ... done
> Getting requirements to build wheel ... error
> error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [60 lines of output]
# pysam: cython is available - using cythonize if necessary
# pysam: htslib mode is shared
# pysam: HTSLIB_CONFIGURE_OPTIONS=None
'.' is not recognized as an internal or external command,
operable program or batch file.
'.' is not recognized as an internal or external command,
operable program or batch file.
# pysam: htslib configure options: None
Traceback (most recent call last):
File "D:\Program Files\python\llama3_env\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in <module>
main()
~~~~^^
File "D:\Program Files\python\llama3_env\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\python\llama3_env\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\srira\AppData\Local\Temp\pip-build-env-sqn_o216\overlay\Lib\site-packages\setuptools\build_meta.py", line 334, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\srira\AppData\Local\Temp\pip-build-env-sqn_o216\overlay\Lib\site-packages\setuptools\build_meta.py", line 304, in _get_build_requires
self.run_setup()
~~~~~~~~~~~~~~^^
File "C:\Users\srira\AppData\Local\Temp\pip-build-env-sqn_o216\overlay\Lib\site-packages\setuptools\build_meta.py", line 522, in run_setup
super().run_setup(setup_script=setup_script)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\srira\AppData\Local\Temp\pip-build-env-sqn_o216\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File "<string>", line 437, in <module>
File "<string>", line 81, in run_make_print_config
File "D:\Program Files\python\Lib\subprocess.py", line 472, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**kwargs).stdout
^^^^^^^^^
File "D:\Program Files\python\Lib\subprocess.py", line 554, in run
with Popen(*popenargs, **kwargs) as process:
~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\python\Lib\subprocess.py", line 1036, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pass_fds, cwd, env,
^^^^^^^^^^^^^^^^^^^
...<5 lines>...
gid, gids, uid, umask,
^^^^^^^^^^^^^^^^^^^^^^
start_new_session, process_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\python\Lib\subprocess.py", line 1548, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
# no special security
^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
cwd,
^^^^
startupinfo)
^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
[end of output]
2
The error you’re encountering is related to the pysam package, which seems to be a dependency of the rust package you’re trying to install. The issue arises because the pysam installation relies on certain build tools or configurations that may not be properly set up in your environment.
Here’s how you can resolve the issue:
- Ensure Prerequisite Tools are Installed
pysam and other similar libraries often require build tools like a C/C++ compiler and Python development headers. Make sure you have these installed:
Windows
Install Build Tools for Visual Studio:
Download and install Microsoft C++ Build Tools.
During installation, select the “C++ Build Tools” workload.
Install cmake if not already available:
Run pip install cmake.
Linux:
sudo apt-get update
sudo apt-get install -y build-essential libz-dev libbz2-dev liblzma-dev libcurl4-openssl-dev
MacOS:
xcode-select --install
brew install cmake zlib bzip2 xz
-
Install Rust Toolchain
The Rust toolchain is required for some dependencies. Use the official Rust installer:curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh
After installation, make sure cargo and rustc are in your PATH:
rustc --version
cargo --version
-
Create a Clean Virtual Environment
Create a new Python virtual environment to avoid conflicts:python -m venv llama3_env
source llama3_env/bin/activate # On Windows, use llama3_envScriptsactivate -
Install setuptools and wheel
Ensure the latest versions of setuptools and wheel are installed, as these are crucial for building Python packages:pip install –upgrade pip setuptools wheel
-
Install transformers Without rust
transformers does not explicitly require the rust package. If you’re installing transformers for Llama3, avoid installing rust directly.
Run the following:
pip install transformers
- If rust is Needed
If you still need rust for your project, install it separately with:
pip install rust
-
Debug Installation Issues
If you still encounter errors, use the –verbose flag with pip to get detailed logs:pip install rust –verbose
-
Alternative: Use Precompiled Wheels
If building pysam or rust fails, try downloading and installing precompiled wheels for your platform:
Visit PyPI and PyPI rust.
Download the appropriate .whl file for your platform.
Install manually
pip install <path_to_wheel_file>