Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NeMo installation fails due to outdated abandoned dependency on youtokentome #6854

Closed
svandiekendialpad opened this issue Jun 12, 2023 · 20 comments
Labels
bug Something isn't working stale

Comments

@svandiekendialpad
Copy link

Describe the bug

NeMo installation fails with Python >=3.9 because youtokentome does not properly specify it's build dependency on cython. See this issue in their repo.. There is also a PR on that repo to fix that but the author seems to have abandoned the project, its last release was in 2020.

Steps/Code to reproduce bug

Trying to install nemo_toolkit using Python 3.9 or above.

Expected behavior

Installation should succeed.

Environment overview (please complete the following information)

  • Environment location: GCP
  • Method of NeMo install:poetry add nemo_toolkit[asr]

Environment details

If NVIDIA docker image is used you don't need to specify these.
Otherwise, please provide:

  • Debian
  • PyTorch 1.13.1 and >2.0
  • Python 3.9, 3.10, 3.11

Additional context

This is particularly annoying given that the whole package depends on youtokentome (see requirements_common.txt). So even if users like me only care about the ASR part, youtokentome must be installed.

@svandiekendialpad svandiekendialpad added the bug Something isn't working label Jun 12, 2023
@titu1994
Copy link
Collaborator

Cython is a requirement of NeMo, so that must always be installed before other libraries. However, we have installed NeMo on python 3.9 for some time without issue using pip.

Though the cython itself has been installed a long time ago so that might be an issue.

Our NMT models depend on YTTM, so worst comes to worst we'll have to find an alternative and deprecate these models. But first we'll take a look at possible resolutions

@github-actions
Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jul 13, 2023
@github-actions
Copy link
Contributor

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2023
@TechInterMezzo
Copy link

Is there a workaround? I can't install nemo_toolkit in my venv under Windows 10.

@LahiLuk
Copy link

LahiLuk commented Aug 17, 2023

This issue is very real, because even though there is a workaround when installing individual libraries using pip or poetry, trying to install from requirements.txt or from poetry.lock fails.

The easiest workaround seems to be to merge the PR @svandiekendialpad mentioned in a fork of the original repo, and then install that project before installing nemo-toolkit.

I have taken this approach, creating the fork @https://github.com/LahiLuk/YouTokenToMe. Leaving it here in case it can help someone as a workaround.

@Arno-Riverside
Copy link

This is still an issue on my end, Cython is not installed by default on my EC2 servers, and having to preinstall a package for production adds unnecessary complexity.

This is frustrating since the workaround is very straightforward and @LahiLuk already provided the PR.

Since the project is abandoned, another workaround would be to specify git@https://github.com/LahiLuk/YouTokenToMe in the requirements.txt

@svandiekendialpad
Copy link
Author

@LahiLuk thanks for your fork. It mentions that it has been tested with Python 3.10. I seem to be able to use poetry add git+https://github.com/LahiLuk/YouTokenToMe.git in Python 3.9 but in 3.10 it fails because pyyaml==5.4.1 is not pep 517 compliant.

@LahiLuk
Copy link

LahiLuk commented Feb 1, 2024

Hi @svandiekendialpad, sorry for the late reply. If this is still a problem, could you please open an issue in https://github.com/LahiLuk/YouTokenToMe/issues? Then I can investigate further. Thanks!

@rpomaris
Copy link

rpomaris commented Feb 8, 2024

@titu1994 - can you please take a look at this again? The latest docs say NeMo is dependent on Python 3.10 or higher, but the installation fails with python>3.9. https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/starthere/intro.html#installation

@titu1994
Copy link
Collaborator

titu1994 commented Feb 8, 2024

Fails how? The CI is running Nemo daily on 3.10.12

@titu1994
Copy link
Collaborator

titu1994 commented Feb 8, 2024

We're basically removing yttm entirely, in #8322

@rpomaris
Copy link

rpomaris commented Feb 8, 2024

I get a ModuleNotFound error for Cython, even though it's installed. Doing pip install "git+https://github.com/LahiLuk/YouTokenToMe" per the guidance above got me past this error. It seems likely deprecating yttm will fix it.

@oerdem19
Copy link

oerdem19 commented Mar 1, 2024

Spend almost a day trying to figure out what is going on with cython moduleNotFound error. Thanks Nvidia for still not fixing this.

@oerdem19
Copy link

oerdem19 commented Mar 1, 2024

Now I get, RuntimeError: pybind11 install failed. Wow, never ends.

@askiefer
Copy link

askiefer commented Mar 3, 2024

^ Yup, I received the same error 😕

@askiefer
Copy link

askiefer commented Mar 3, 2024

Okay, these steps actually worked for me! 🎉

pip install pybind11
pip install wheel setuptools pip --upgrade
pip install fasttext
pip install "nemo_toolkit[all]"

@rdzotz
Copy link

rdzotz commented Mar 20, 2024

I get this error when running those steps above

`Collecting megatron-core==0.4.0 (from nemo_toolkit[all])
Using cached megatron_core-0.4.0.tar.gz (154 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
╰─> [18 lines of output]
Traceback (most recent call last):
File "/Users/reubenzotz-wilson/miniconda3/envs/nemo/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/Users/reubenzotz-wilson/miniconda3/envs/nemo/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Users/reubenzotz-wilson/miniconda3/envs/nemo/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/private/var/folders/g1/g7q_sfdj4bj0fw0y82887pc80000gn/T/pip-build-env-fqgq2num/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/private/var/folders/g1/g7q_sfdj4bj0fw0y82887pc80000gn/T/pip-build-env-fqgq2num/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
self.run_setup()
File "/private/var/folders/g1/g7q_sfdj4bj0fw0y82887pc80000gn/T/pip-build-env-fqgq2num/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
super().run_setup(setup_script=setup_script)
File "/private/var/folders/g1/g7q_sfdj4bj0fw0y82887pc80000gn/T/pip-build-env-fqgq2num/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "", line 52, in
File "", line 45, in req_file
FileNotFoundError: [Errno 2] No such file or directory: 'megatron/core/requirements.txt'
[end of output]`

@titu1994
Copy link
Collaborator

Can you try pip install --upgrade nemo_toolkit[all] to make sure you're trying to install nemo 1.23?

@stalevna
Copy link

stalevna commented Jul 18, 2024

Running pip3 install --upgrade --no-cache-dir "nemo_toolkit[all]" on python3.10.12, Cython is installed, but getting


  Using cached youtokentome-1.0.6.tar.gz (86 kB)

  Installing build dependencies ... done

  Getting requirements to build wheel ... error

  error: subprocess-exited-with-error

File "<string>", line 5, in <module>

      ModuleNotFoundError: No module named 'Cython'

      [end of output]

@WilliamVenner
Copy link

Also getting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests