I'm using Anaconda3-2024.02-1-Windows-x86_64 (yes, Windows 64) on windows 11, with python 3.11.7. I was trying to build an offline translator and i forgot what led to what... Eventually i was trying to install EasyNMT and it faild because of fasttext package. Then, I decided to install fasttext separately but failed and can't seem to know what the problem is. I am using pip on Anaconda Prompt to install almost all my packages. And I suffer from a weak internet connection. The code is below:
(base) C:\Users\pc>pip install wheel
Collecting fasttext
Using cached fasttext-0.9.2.tar.gz (68 kB)
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
╰─> [28 lines of output]
C:\Users\pc\anaconda3\python.exe: No module named pip
Traceback (most recent call last):
File "<string>", line 38, in __init__
ModuleNotFoundError: No module named 'pybind11'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\pc\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\pc\anaconda3\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 "C:\Users\pc\anaconda3\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\pc\AppData\Local\Temp\pip-build-env-31ahp4pz\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\pc\AppData\Local\Temp\pip-build-env-31ahp4pz\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "C:\Users\pc\AppData\Local\Temp\pip-build-env-31ahp4pz\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\pc\AppData\Local\Temp\pip-build-env-31ahp4pz\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 72, in <module>
File "<string>", line 41, in __init__
RuntimeError: pybind11 install failed.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I have just updated my MS Build Tools for Visual Studio because of another project. I tried to install pybind11 on it's own. and it was already downloaded I guess. pip install pybind11 Requirement already satisfied: pybind11 in c:\users\pc\anaconda3\lib\site-packages (2.11.1)
So!!!! I don't know what to do...... HELP ME PLEASE!!
UPDATE!! I did start clean after the answer given below and everything went smoothly until I installed easyNMT and I got this error message:
(base) C:\Windows\System32>pip install -U easynmt
Collecting easynmt
Using cached EasyNMT-2.0.2-py3-none-any.whl
Requirement already satisfied: tqdm in c:\users\pc\appdata\roaming\python\python311\site-packages (from easynmt) (4.66.1)
Requirement already satisfied: transformers<5,>=4.4 in c:\users\pc\anaconda3\lib\site-packages (from easynmt) (4.32.1)
Requirement already satisfied: torch>=1.6.0 in c:\users\pc\anaconda3\lib\site-packages (from easynmt) (2.2.1)
Requirement already satisfied: numpy in c:\users\pc\appdata\roaming\python\python311\site-packages (from easynmt) (1.24.2)
Requirement already satisfied: nltk in c:\users\pc\appdata\roaming\python\python311\site-packages (from easynmt) (3.8.1)
Requirement already satisfied: sentencepiece in c:\users\pc\anaconda3\lib\site-packages (from easynmt) (0.2.0)
Collecting fasttext (from easynmt)
Using cached fasttext-0.9.2.tar.gz (68 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: protobuf in c:\users\pc\anaconda3\lib\site-packages (from easynmt) (5.26.0)
Requirement already satisfied: filelock in c:\users\pc\anaconda3\lib\site-packages (from torch>=1.6.0->easynmt) (3.9.0)
Requirement already satisfied: typing-extensions>=4.8.0 in c:\users\pc\anaconda3\lib\site-packages (from torch>=1.6.0->easynmt) (4.10.0)
Requirement already satisfied: sympy in c:\users\pc\anaconda3\lib\site-packages (from torch>=1.6.0->easynmt) (1.11.1)
Requirement already satisfied: networkx in c:\users\pc\anaconda3\lib\site-packages (from torch>=1.6.0->easynmt) (3.1)
Requirement already satisfied: jinja2 in c:\users\pc\anaconda3\lib\site-packages (from torch>=1.6.0->easynmt) (3.1.2)
Requirement already satisfied: fsspec in c:\users\pc\anaconda3\lib\site-packages (from torch>=1.6.0->easynmt) (2023.4.0)
Requirement already satisfied: huggingface-hub<1.0,>=0.15.1 in c:\users\pc\anaconda3\lib\site-packages (from transformers<5,>=4.4->easynmt) (0.15.1)
Requirement already satisfied: packaging>=20.0 in c:\users\pc\anaconda3\lib\site-packages (from transformers<5,>=4.4->easynmt) (23.1)
Requirement already satisfied: pyyaml>=5.1 in c:\users\pc\anaconda3\lib\site-packages (from transformers<5,>=4.4->easynmt) (6.0)
Requirement already satisfied: regex!=2019.12.17 in c:\users\pc\appdata\roaming\python\python311\site-packages (from transformers<5,>=4.4->easynmt) (2023.12.25)
Requirement already satisfied: requests in c:\users\pc\anaconda3\lib\site-packages (from transformers<5,>=4.4->easynmt) (2.31.0)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in c:\users\pc\anaconda3\lib\site-packages (from transformers<5,>=4.4->easynmt) (0.13.2)
Requirement already satisfied: safetensors>=0.3.1 in c:\users\pc\anaconda3\lib\site-packages (from transformers<5,>=4.4->easynmt) (0.3.2)
Requirement already satisfied: colorama in c:\users\pc\appdata\roaming\python\python311\site-packages (from tqdm->easynmt) (0.4.6)
Requirement already satisfied: pybind11>=2.2 in c:\users\pc\anaconda3\lib\site-packages (from fasttext->easynmt) (2.11.1)
Requirement already satisfied: setuptools>=0.7.0 in c:\users\pc\anaconda3\lib\site-packages (from fasttext->easynmt) (68.0.0)
Requirement already satisfied: click in c:\users\pc\appdata\roaming\python\python311\site-packages (from nltk->easynmt) (8.1.7)
Requirement already satisfied: joblib in c:\users\pc\appdata\roaming\python\python311\site-packages (from nltk->easynmt) (1.3.2)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\pc\anaconda3\lib\site-packages (from jinja2->torch>=1.6.0->easynmt) (2.1.1)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\pc\anaconda3\lib\site-packages (from requests->transformers<5,>=4.4->easynmt) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in c:\users\pc\anaconda3\lib\site-packages (from requests->transformers<5,>=4.4->easynmt) (3.4)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\pc\anaconda3\lib\site-packages (from requests->transformers<5,>=4.4->easynmt) (1.26.16)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\pc\anaconda3\lib\site-packages (from requests->transformers<5,>=4.4->easynmt) (2024.2.2)
Requirement already satisfied: mpmath>=0.19 in c:\users\pc\anaconda3\lib\site-packages (from sympy->torch>=1.6.0->easynmt) (1.3.0)
Building wheels for collected packages: fasttext
Building wheel for fasttext (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [75 lines of output]
C:\Users\pc\anaconda3\Lib\site-packages\setuptools\dist.py:745: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!
********************************************************************************
Usage of dash-separated 'description-file' will not be supported in future
versions. Please use the underscore name 'description_file' instead.
This deprecation is overdue, please update your project and remove deprecated
calls to avoid build errors in the future.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
opt = self.warn_dash_deprecation(opt, section)
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\fasttext
copying python\fasttext_module\fasttext\FastText.py -> build\lib.win-amd64-cpython-311\fasttext
copying python\fasttext_module\fasttext\__init__.py -> build\lib.win-amd64-cpython-311\fasttext
creating build\lib.win-amd64-cpython-311\fasttext\util
copying python\fasttext_module\fasttext\util\util.py -> build\lib.win-amd64-cpython-311\fasttext\util
copying python\fasttext_module\fasttext\util\__init__.py -> build\lib.win-amd64-cpython-311\fasttext\util
creating build\lib.win-amd64-cpython-311\fasttext\tests
copying python\fasttext_module\fasttext\tests\test_configurations.py -> build\lib.win-amd64-cpython-311\fasttext\tests
copying python\fasttext_module\fasttext\tests\test_script.py -> build\lib.win-amd64-cpython-311\fasttext\tests
copying python\fasttext_module\fasttext\tests\__init__.py -> build\lib.win-amd64-cpython-311\fasttext\tests
running build_ext
building 'fasttext_pybind' extension
creating build\temp.win-amd64-cpython-311
creating build\temp.win-amd64-cpython-311\Release
creating build\temp.win-amd64-cpython-311\Release\python
creating build\temp.win-amd64-cpython-311\Release\python\fasttext_module
creating build\temp.win-amd64-cpython-311\Release\python\fasttext_module\fasttext
creating build\temp.win-amd64-cpython-311\Release\python\fasttext_module\fasttext\pybind
creating build\temp.win-amd64-cpython-311\Release\src
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\pc\anaconda3\Lib\site-packages\pybind11\include -IC:\Users\pc\anaconda3\Lib\site-packages\pybind11\include -Isrc -IC:\Users\pc\anaconda3\include -IC:\Users\pc\anaconda3\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /EHsc /Tppython/fasttext_module/fasttext/pybind/fasttext_pybind.cc /Fobuild\temp.win-amd64-cpython-311\Release\python/fasttext_module/fasttext/pybind/fasttext_pybind.obj /EHsc /DVERSION_INFO=\\\"0.9.2\\\"
fasttext_pybind.cc
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2672: 'pybind11::init': no matching overloaded function found
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1932): note: could be 'Ret pybind11::init(CFunc &&,AFunc &&)'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): note: 'pybind11::init': invalid template argument for 'CFunc', type expected
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1924): note: or 'Ret pybind11::init(Func &&)'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): note: 'pybind11::init': invalid template argument for 'Func', type expected
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1912): note: or 'pybind11::detail::initimpl::constructor<Args...> pybind11::init(void)'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): note: 'pybind11::init': invalid template argument for 'Args', type expected
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): error C2672: 'pybind11::class_<fasttext::Vector>::def': no matching overloaded function found
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1631): note: could be 'pybind11::class_<fasttext::Vector> &pybind11::class_<fasttext::Vector>::def(pybind11::detail::initimpl::pickle_factory<Args...> &&,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1625): note: or 'pybind11::class_<fasttext::Vector> &pybind11::class_<fasttext::Vector>::def(pybind11::detail::initimpl::factory<Args...> &&,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1618): note: or 'pybind11::class_<fasttext::Vector> &pybind11::class_<fasttext::Vector>::def(const pybind11::detail::initimpl::alias_constructor<Args...> &,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1611): note: or 'pybind11::class_<fasttext::Vector> &pybind11::class_<fasttext::Vector>::def(const pybind11::detail::initimpl::constructor<Args...> &,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1599): note: or 'pybind11::class_<fasttext::Vector> &pybind11::class_<fasttext::Vector>::def(const T &,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1574): note: or 'pybind11::class_<fasttext::Vector> &pybind11::class_<fasttext::Vector>::def(const char *,Func &&,const Extra &...)'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(171): note: 'pybind11::class_<fasttext::Vector> &pybind11::class_<fasttext::Vector>::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2065: 'ssize_t': undeclared identifier
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2672: 'pybind11::init': no matching overloaded function found
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1932): note: could be 'Ret pybind11::init(CFunc &&,AFunc &&)'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): note: 'pybind11::init': invalid template argument for 'CFunc', type expected
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1924): note: or 'Ret pybind11::init(Func &&)'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): note: 'pybind11::init': invalid template argument for 'Func', type expected
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1912): note: or 'pybind11::detail::initimpl::constructor<Args...> pybind11::init(void)'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): note: 'pybind11::init': invalid template argument for 'Args', type expected
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): error C2672: 'pybind11::class_<fasttext::DenseMatrix>::def': no matching overloaded function found
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1631): note: could be 'pybind11::class_<fasttext::DenseMatrix> &pybind11::class_<fasttext::DenseMatrix>::def(pybind11::detail::initimpl::pickle_factory<Args...> &&,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1625): note: or 'pybind11::class_<fasttext::DenseMatrix> &pybind11::class_<fasttext::DenseMatrix>::def(pybind11::detail::initimpl::factory<Args...> &&,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1618): note: or 'pybind11::class_<fasttext::DenseMatrix> &pybind11::class_<fasttext::DenseMatrix>::def(const pybind11::detail::initimpl::alias_constructor<Args...> &,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1611): note: or 'pybind11::class_<fasttext::DenseMatrix> &pybind11::class_<fasttext::DenseMatrix>::def(const pybind11::detail::initimpl::constructor<Args...> &,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1599): note: or 'pybind11::class_<fasttext::DenseMatrix> &pybind11::class_<fasttext::DenseMatrix>::def(const T &,const Extra &...)'
C:\Users\pc\anaconda3\Lib\site-packages\pybind11\include\pybind11\pybind11.h(1574): note: or 'pybind11::class_<fasttext::DenseMatrix> &pybind11::class_<fasttext::DenseMatrix>::def(const char *,Func &&,const Extra &...)'
python/fasttext_module/fasttext/pybind/fasttext_pybind.cc(185): note: 'pybind11::class_<fasttext::DenseMatrix> &pybind11::class_<fasttext::DenseMatrix>::def(const char *,Func &&,const Extra &...)': expects 3 arguments - 1 provided
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for fasttext
Running setup.py clean for fasttext
Failed to build fasttext
ERROR: Could not build wheels for fasttext, which is required to install pyproject.toml-based projects
When things have gone this wrong – installations are failing, perhaps because of other earlier choices (or unnoticed failures) that aren't clearly remembered – it's best to start fresh, in a clean environment.
Then, gradually add back what's needed in some logical order, paying close attention (taking notes) for either the 1st indications of what's gone wrong, or what exact/minimal set of steps works.
If using Anaconda, you likely have access to the 'conda' tool for managing separate "virtual environments" that each have their own specifically-chosen set of installed packages. Use that to make a fresh environment, activate that environment, then step-by-step install what you need.
If that process hits errors, you'll at least have more exact information to describe how you got to the error – which would generate a StackOverflow question that might offer more-specific potential solutions.