PyPI install fails with "FileNotFoundError: [Errno 2] No such file or directory: 'fairseq/version.txt'"
See original GitHub issue🐛 Bug
I’m trying to install fairseq from PyPI and the install is failing to find ‘fairseq/version.txt’.
I was able to install successfully by cloning the code from GitHub and running pip install .
in the root directory. My guess is that the installer is expecting to be in the root directory of the code to find fairseq/version.txt
and breaks installing from PyPI.
$ pip install fairseq
Collecting fairseq
Using cached fairseq-0.12.1.tar.gz (9.6 MB)
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 "/home/argosopentech/temp/env/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/argosopentech/temp/env/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/argosopentech/temp/env/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-iwbeosu0/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
return self._get_build_requires(
File "/tmp/pip-build-env-iwbeosu0/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-iwbeosu0/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 174, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 27, in <module>
version = write_version_py()
File "setup.py", line 18, in write_version_py
with open(os.path.join("fairseq", "version.txt")) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'fairseq/version.txt'
[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.
Environment
- fairseq Version: 0.12.1
- PyTorch Version: 1.11.0
- OS: Ubuntu 22.04
- Python version: 3.10.4
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
pip install FileNotFoundError: [Errno 2] No such file or directory
In my case with the same error, the solution was to do pip3 install --upgrade pip. It was my pip3 that was in...
Read more >filenotfounderror: [errno 2] no such file or directory: 'clientes.txt'
Bug. I'm trying to install fairseq from PyPI and the install is failing to find 'fairseq/version.txt'. I was able to install successfully by...
Read more >pip 1.2.1 - PyPI
pip is a tool for installing and managing Python packages, such as those found in ... Write failure log to temp file if...
Read more >When trying to install fn package failed due to IOError: [Errno 2 ...
When trying to install fn package failed due to IOError: [Errno 2] No such file or directory:
Read more >How to Publish an Open-Source Python Package to PyPI
(venv) $ python -m pip install -e . Throughout the tutorial, you'll learn more about what happens under the hood when you run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It works for me now thanks!
Thank you for reporting this issue, taking a look!