garak icon indicating copy to clipboard operation
garak copied to clipboard

Build on windows failing due to ecoji lib dependency

Open jnpushkar1507 opened this issue 1 year ago • 11 comments

PS C:\Users\akncsjnas\Desktop\PT\LLM\garak> pip install -e .
Obtaining file:///C:/Users/acsascassc/Desktop/PT/LLM/garak
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Collecting base2048>=0.1.3 (from garak==0.9.0.12.post1)
  Using cached base2048-0.1.3-cp37-abi3-win_amd64.whl.metadata (4.2 kB)
Collecting transformers>=4.19 (from garak==0.9.0.12.post1)
  Using cached transformers-4.38.1-py3-none-any.whl.metadata (131 kB)
Collecting datasets>=2 (from garak==0.9.0.12.post1)
  Using cached datasets-2.17.1-py3-none-any.whl.metadata (20 kB)
Requirement already satisfied: colorama>=0.4.3 in c:\python312\lib\site-packages (from garak==0.9.0.12.post1) (0.4.6)
Requirement already satisfied: tqdm>=4.64.0 in c:\python312\lib\site-packages (from garak==0.9.0.12.post1) (4.66.1)
Collecting cohere>=4.5.1 (from garak==0.9.0.12.post1)
  Using cached cohere-4.48-py3-none-any.whl.metadata (6.0 kB)
Collecting openai==1.12.0 (from garak==0.9.0.12.post1)
  Using cached openai-1.12.0-py3-none-any.whl.metadata (18 kB)
Collecting replicate>=0.8.3 (from garak==0.9.0.12.post1)
  Using cached replicate-0.24.0-py3-none-any.whl.metadata (23 kB)
Collecting pytest>=8.0 (from garak==0.9.0.12.post1)
  Using cached pytest-8.0.1-py3-none-any.whl.metadata (7.7 kB)
Collecting google-api-python-client>=2.0 (from garak==0.9.0.12.post1)
  Using cached google_api_python_client-2.118.0-py2.py3-none-any.whl.metadata (6.6 kB)
Collecting backoff>=2.1.1 (from garak==0.9.0.12.post1)
  Using cached backoff-2.2.1-py3-none-any.whl.metadata (14 kB)
Collecting rapidfuzz>=3.0.0 (from garak==0.9.0.12.post1)
  Using cached rapidfuzz-3.6.1-cp312-cp312-win_amd64.whl.metadata (11 kB)
Collecting jinja2>=3.1.2 (from garak==0.9.0.12.post1)
  Using cached Jinja2-3.1.3-py3-none-any.whl.metadata (3.3 kB)
Collecting nltk>=3.8.1 (from garak==0.9.0.12.post1)
  Using cached nltk-3.8.1-py3-none-any.whl.metadata (2.8 kB)
Collecting accelerate>=0.23.0 (from garak==0.9.0.12.post1)
  Using cached accelerate-0.27.2-py3-none-any.whl.metadata (18 kB)
Collecting avidtools==0.1.1.2 (from garak==0.9.0.12.post1)
  Using cached avidtools-0.1.1.2-py3-none-any.whl.metadata (290 bytes)
Collecting stdlibs>=2022.10.9 (from garak==0.9.0.12.post1)
  Using cached stdlibs-2024.1.28-py3-none-any.whl.metadata (4.9 kB)
Collecting langchain>=0.0.300 (from garak==0.9.0.12.post1)
  Using cached langchain-0.1.8-py3-none-any.whl.metadata (13 kB)
Collecting nemollm>=0.3.0 (from garak==0.9.0.12.post1)
  Using cached nemollm-0.3.5-py3-none-any.whl.metadata (4.2 kB)
Collecting octoai-sdk>=0.8.0 (from garak==0.9.0.12.post1)
  Using cached octoai_sdk-0.9.0-py3-none-any.whl.metadata (1.3 kB)
Collecting cmd2==2.4.3 (from garak==0.9.0.12.post1)
  Using cached cmd2-2.4.3-py3-none-any.whl.metadata (12 kB)
Collecting torch>=2.1.0 (from garak==0.9.0.12.post1)
  Using cached torch-2.2.0-cp312-cp312-win_amd64.whl.metadata (26 kB)
Collecting sentencepiece>=0.1.99 (from garak==0.9.0.12.post1)
  Using cached sentencepiece-0.2.0-cp312-cp312-win_amd64.whl.metadata (8.3 kB)
Collecting markdown>=3.4.3 (from garak==0.9.0.12.post1)
  Using cached Markdown-3.5.2-py3-none-any.whl.metadata (7.0 kB)
Requirement already satisfied: numpy>=1.26.1 in c:\python312\lib\site-packages (from garak==0.9.0.12.post1) (1.26.3)
Collecting zalgolib>=0.2.2 (from garak==0.9.0.12.post1)
  Using cached zalgolib-0.2.2-py3-none-any.whl.metadata (6.8 kB)
Collecting ecoji>=0.1.0 (from garak==0.9.0.12.post1)
  Using cached ecoji-0.1.0.tar.gz (6.5 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\pujain\AppData\Local\Temp\pip-install-2i3kwylg\ecoji_f2d2247e7796412c8a98e532a917010f\setup.py", line 9, in <module>
          long_description=open("README.md").read(),
                           ^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Python312\Lib\encodings\cp1252.py", line 23, in decode
          return codecs.charmap_decode(input,self.errors,decoding_table)[0]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 10: character maps to <undefined>
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

jnpushkar1507 avatar Feb 22 '24 06:02 jnpushkar1507

thanks for this. will take a look once we're able to test on windows.

leondz avatar Mar 24 '24 12:03 leondz

+1! Garak installation is not working on windows.

cyberjj999 avatar Mar 29 '24 13:03 cyberjj999

Ref: mecforlove/ecoji-py/issues/4

jmartin-tech avatar Apr 23 '24 15:04 jmartin-tech

Thanks for this report. Should be fixed by #626 which is now merged - please re-open if still broken

leondz avatar Apr 26 '24 11:04 leondz

I tried again this is the error I am getting on windows . Is anyone else facing the same issue ?

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [10 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "\pip-install-1x837ryc\ecoji_4731f0a1e2924af691171bfc16bf785b\setup.py", line 9, in long_description=open("README.md").read(), ^^^^^^^^^^^^^^^^^^^^^^^^ File ings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 10: character maps to [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

rsrinivasanhome avatar May 16 '24 05:05 rsrinivasanhome

We tried on 3 machines and it worked on 1 of them

rsrinivasanhome avatar May 16 '24 11:05 rsrinivasanhome

Can you show more of the debug trace, including which versions of garak and ecoji are being summoned? This particular bug is due to a windows bug in the ecoji lib, and we'd like to be able to work around that.

leondz avatar May 16 '24 11:05 leondz

This issue is not within this project's code. The ecoji v0.1.0 lib cannot install on windows for current Python versions as currently published on PyPI. PR https://github.com/mecforlove/ecoji-py/pull/5 has been offered to the project that will address the install issue however the maintainers will have to merge and release that project.

The workaround is to checkout the ecoji repository and patch the package to install it on windows and then install the remaining requirements for garak. An example of this is shown here:

git clone https://github.com/leondz/garak
git clone https://github.com/mecforlove/ecoji-py

python -m pip install --upgrade pip
cd ecoji-py
echo "mitigate" > README.md
pip install setuptools
python setup.py install
cd ../garak
pip install -r requirements.txt

jmartin-tech avatar May 16 '24 14:05 jmartin-tech

here are the logs I got log.txt

rsrinivasanhome avatar May 16 '24 14:05 rsrinivasanhome

for the workaround this is what I am getting ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. aiobotocore 2.7.0 requires botocore<1.31.65,>=1.31.16, but you have botocore 1.34.106 which is incompatible. anaconda-cloud-auth 0.1.4 requires pydantic<2.0, but you have pydantic 2.7.1 which is incompatible. conda-repo-cli 1.0.75 requires clyent==1.2.1, but you have clyent 1.2.2 which is incompatible. spyder 5.4.3 requires pylint<3.0,>=2.5.0, but you have pylint 3.2.0 which is incompatible.

rsrinivasanhome avatar May 16 '24 14:05 rsrinivasanhome

This is again python env related and not something the project controls, I would suggest using a python virtual environment of some sort to be able to generated an available packages path for the env that is compatible.

There are various methods to do this that are all out of scope for this project to document, however consider a conda environment or using venv.

jmartin-tech avatar May 16 '24 14:05 jmartin-tech