prajdabre / yanmtt

Yet Another Neural Machine Translation Toolkit
MIT License
174 stars 32 forks source link

Problem with __future__ annotation #59

Open yash-srivastava19 opened 1 year ago

yash-srivastava19 commented 1 year ago

Following through the instructions in the repo, there seems to be some problem with the installation of the custom transformers package with the issue :

No module named 'setuptools_rust'

System configs : OS : Ubuntu 22.04 LTS

The log produced : `... Installed /home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/transformers-4.3.2-py3.6.egg Processing dependencies for transformers==4.3.2 Searching for tokenizers<0.11,>=0.10.1 Reading https://pypi.org/simple/tokenizers/ /home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/pkg_resources/init.py:119: PkgResourcesDeprecationWarning: is an invalid version and will not be supported in a future release PkgResourcesDeprecationWarning, Downloading https://files.pythonhosted.org/packages/48/2b/b99184cacb1a743edc18290e9127d1b0e658c0c46f2ab5290b27fe865ff4/tokenizers-0.10.3.tar.gz#sha256=1a5d3b596c6d3a237e1ad7f46c472d467b0246be7fd1a364f12576eb8db8f7e6 Best match: tokenizers 0.10.3 Processing tokenizers-0.10.3.tar.gz Writing /tmp/easy_install-yusrqbr4/tokenizers-0.10.3/setup.cfg Running tokenizers-0.10.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-yusrqbr4/tokenizers-0.10.3/egg-dist-tmp-3955d72l Traceback (most recent call last): File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 156, in save_modules yield saved File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context yield File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 259, in run_setup _execfile(setup_script, ns) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 46, in _execfile exec(code, globals, locals) File "/tmp/easy_install-yusrqbr4/tokenizers-0.10.3/setup.py", line 2, in # ModuleNotFoundError: No module named 'setuptools_rust'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "setup.py", line 312, in cmdclass={"deps_table_update": DepsTableUpdateCommand}, File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/install.py", line 74, in run self.do_egg_install() File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/install.py", line 124, in do_egg_install cmd.run(show_deprecation=False) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 414, in run self.easy_install(spec, not self.no_deps) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 656, in easy_install return self.install_item(None, spec, tmpdir, deps, True) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 703, in install_item self.process_distribution(spec, dist, deps) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 751, in process_distribution [requirement], self.local_index, self.easy_install File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 773, in resolve replace_conflicting=replace_conflicting File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 1056, in best_match return self.obtain(req, installer) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/pkg_resources/init.py", line 1068, in obtain return installer(requirement) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 675, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 701, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 896, in install_eggs return self.build_and_install(setup_script, setup_base) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1168, in build_and_install self.run_setup(setup_script, setup_base, args) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1152, in run_setup run_setup(setup_script, args) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 262, in run_setup raise File "/usr/local/lib/python3.6/contextlib.py", line 99, in exit self.gen.throw(type, value, traceback) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context yield File "/usr/local/lib/python3.6/contextlib.py", line 99, in exit self.gen.throw(type, value, traceback) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 169, in save_modules saved_exc.resume() File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 143, in resume raise exc.with_traceback(self._tb) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 156, in save_modules yield saved File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 198, in setup_context yield File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 259, in run_setup _execfile(setup_script, ns) File "/home/ysriv/PycharmProjects/Intern-YANMTT/venv/lib/python3.6/site-packages/setuptools/sandbox.py", line 46, in _execfile exec(code, globals, locals) File "/tmp/easy_install-yusrqbr4/tokenizers-0.10.3/setup.py", line 2, in # ModuleNotFoundError: No module named 'setuptools_rust'`

Any help with this would be highly appreciated !!!

yash-srivastava19 commented 1 year ago

I tried rectifying the above error, and was met with __future__ annotations error. The request library installed gave the future annotation error, as it is incompatible for Python version < 3.7

With some googling, I tried using the future annotation package for our Python version(3.6.8) This, however spirals down and the train_mbart.sh and other bash scripts don't run.

Any help in this regard would be really appreciated...