QData / TextAttack

TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP https://textattack.readthedocs.io/en/master/
https://textattack.readthedocs.io/en/master/
MIT License
2.95k stars 395 forks source link

Setup issue: fatal error C1083: Cannot open compiler generated file: '': Invalid argument #711

Open raulkviana opened 1 year ago

raulkviana commented 1 year ago

Hello,

I'm tried to install textattack using pip package and also through the source option and I'm always getting the same error message. I've already tried to update pip, but I still get the same error message:

Building wheels for collected packages: pycld2
  Building wheel for pycld2 (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [41 lines of output]
      C:\some_folder\Python\Python39\lib\site-packages\setuptools\config\setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      The [wheel] section is deprecated. Use [bdist_wheel] instead.
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-39
      creating build\lib.win-amd64-cpython-39\pycld2
      copying pycld2\__init__.py -> build\lib.win-amd64-cpython-39\pycld2
      running build_ext
      building 'pycld2._pycld2' extension
      creating build\temp.win-amd64-cpython-39
      creating build\temp.win-amd64-cpython-39\Release
      creating build\temp.win-amd64-cpython-39\Release\Users
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal
      "c:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\public -IC:\some_folder\Python\Python39\include -IC:\some_folder\Python\Python39\Include "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /TpC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings\encodings.cc /Fobuild\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings\encodings.obj -w -O2 -m64 -fPIC      
      cl : Command line warning D9025 : overriding '/W3' with '/w'
      cl : Command line warning D9002 : ignoring unknown option '-m64'
      cl : Command line warning D9002 : ignoring unknown option '-fPIC'
      encodings.cc
      "c:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\public -IC:\some_folder\Python\Python39\include -IC:\some_folder\Python\Python39\Include "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /TpC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings\pycldmodule.cc /Fobuild\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings\pycldmodule.obj -w -O2 -m64 -fPIC  
      cl : Command line warning D9025 : overriding '/W3' with '/w'
      cl : Command line warning D9002 : ignoring unknown option '-m64'
      cl : Command line warning D9002 : ignoring unknown option '-fPIC'
      pycldmodule.cc
      "c:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\public -IC:\some_folder\Python\Python39\include -IC:\some_folder\Python\Python39\Include "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /TpC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal/cld2_generated_cjk_compatible.cc /Fobuild\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal/cld2_generated_cjk_compatible.obj -w -O2 -m64 -fPIC
      cl : Command line warning D9025 : overriding '/W3' with '/w'
      cl : Command line warning D9002 : ignoring unknown option '-m64'
      cl : Command line warning D9002 : ignoring unknown option '-fPIC'
      cld2_generated_cjk_compatible.cc
      C:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal\cld2_generated_cjk_compatible.cc : fatal error C1083: Cannot open compiler generated file: '': Invalid argument
      error: command 'c:\\some_folder\\Microsoft Visual Studio\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycld2
  Running setup.py clean for pycld2
Failed to build pycld2
Installing collected packages: pycld2, py4j, pptree, pinyin, overrides, mpld3, lru-dict, jieba, janome, docopt, zipp, xxhash, wrapt, urllib3, typing-extensions, threadpoolctl, terminaltables, tabulate, soupsieve, smart-open, six, regex, pyyaml, PySocks, pyparsing, pillow, packaging, numpy, num2words, networkx, multidict, more-itertools, lxml, kiwisolver, joblib, idna, future, ftfy, fsspec, frozenlist, fonttools, editdistance, dill, Cython, cycler, conllu, colorama, cloudpickle, charset-normalizer, certifi, attrs, async-timeout, yarl, tqdm, torch, segtok, scipy, requests, python-dateutil, pyarrow, multiprocess, lemminflect, langdetect, importlib-metadata, deprecated, contourpy, click, beautifulsoup4, anytree, aiosignal, wikipedia-api, simpful, scikit-learn, responses, pandas, OpenHowNet, nltk, miniful, matplotlib, language_tool_python, konoha, hyperopt, huggingface-hub, aiohttp, transformers, gdown, fst-pso, pyfume, datasets, bert-score, FuzzyTM, gensim, bpemb, flair, textattack
  Running setup.py install for pycld2 ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pycld2 did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      C:\some_folder\Python\Python39\lib\site-packages\setuptools\config\setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running install
      C:\some_folder\Python\Python39\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-39
      creating build\lib.win-amd64-cpython-39\pycld2
      copying pycld2\__init__.py -> build\lib.win-amd64-cpython-39\pycld2
      running build_ext
      building 'pycld2._pycld2' extension
      creating build\temp.win-amd64-cpython-39
      creating build\temp.win-amd64-cpython-39\Release
      creating build\temp.win-amd64-cpython-39\Release\Users
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2
      creating build\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal
      "c:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\public -IC:\some_folder\Python\Python39\include -IC:\some_folder\Python\Python39\Include "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /TpC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings\encodings.cc /Fobuild\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings\encodings.obj -w -O2 -m64 -fPIC      
      cl : Command line warning D9025 : overriding '/W3' with '/w'
      cl : Command line warning D9002 : ignoring unknown option '-m64'
      cl : Command line warning D9002 : ignoring unknown option '-fPIC'
      encodings.cc
      "c:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\public -IC:\some_folder\Python\Python39\include -IC:\some_folder\Python\Python39\Include "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /TpC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings\pycldmodule.cc /Fobuild\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\bindings\pycldmodule.obj -w -O2 -m64 -fPIC  
      cl : Command line warning D9025 : overriding '/W3' with '/w'
      cl : Command line warning D9002 : ignoring unknown option '-m64'
      cl : Command line warning D9002 : ignoring unknown option '-fPIC'
      pycldmodule.cc
      "c:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal -IC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\public -IC:\some_folder\Python\Python39\include -IC:\some_folder\Python\Python39\Include "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-Ic:\some_folder\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /EHsc /TpC:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal/cld2_generated_cjk_compatible.cc /Fobuild\temp.win-amd64-cpython-39\Release\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal/cld2_generated_cjk_compatible.obj -w -O2 -m64 -fPIC
      cl : Command line warning D9025 : overriding '/W3' with '/w'
      cl : Command line warning D9002 : ignoring unknown option '-m64'
      cl : Command line warning D9002 : ignoring unknown option '-fPIC'
      cld2_generated_cjk_compatible.cc
      C:\Users\xxx\AppData\Local\Temp\pip-install-zc43aqei\pycld2_842e29bfe00540bc8c314808a0cc68a9\cld2\internal\cld2_generated_cjk_compatible.cc : fatal error C1083: Cannot open compiler generated file: '': Invalid argument
      error: command 'c:\\some_folder\\Microsoft Visual Studio\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycld2

Does anyone know how to solve this? I'll try to install it in another computer to see if it works, meanwhile.

raulkviana commented 1 year ago

Installing in another PC yielded the same result

jxmorris12 commented 1 year ago

Hi @raulkviana. There is something strange about your environment. Are you installing through windows subsystem for linux? If not, can you try that?

raulkviana commented 1 year ago

I'll try installing it in WSL in my own PC. I'll update here has soon as I can.

jxmorris12 commented 1 year ago

thanks! There are a lot of dependencies, like TensorFlow and the various HuggingFace libraries, that might not install properly on Windows. I don't think the issue you're running into is actually specific to TextAttack (might be wrong though).