LeiRoF
LeiRoF

Reputation: 11

"requirements.txt" not found when I try to build my python package

I try to run python3 -m build to send a package on Pypi but i makes me this error:

Traceback (most recent call last):
  File "C:\Users\vince\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pep517\in_process\_in_process.py", line 363, in <module>
    main()
  File "C:\Users\vince\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pep517\in_process\_in_process.py", line 345, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "C:\Users\vince\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel     
    return hook(config_settings)
  File "C:\Users\vince\AppData\Local\Temp\build-env-kpv0_9rj\lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
  File "C:\Users\vince\AppData\Local\Temp\build-env-kpv0_9rj\lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
    self.run_setup()
  File "C:\Users\vince\AppData\Local\Temp\build-env-kpv0_9rj\lib\site-packages\setuptools\build_meta.py", line 483, in run_setup
    super(_BuildMetaLegacyBackend,
  File "C:\Users\vince\AppData\Local\Temp\build-env-kpv0_9rj\lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
    exec(code, locals())
  File "<string>", line 4, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel

But as you can see in the file tree (see image), the requirement file exists and I run the command in the correct directory 🤔enter image description here

I tried to add the -s flag on the build command but then it makes error when I try to import the module frome pypi, it's doesn't find any requirements.txt file.

Upvotes: 1

Views: 2371

Answers (2)

Oriol Piera
Oriol Piera

Reputation: 31

Create the file MANIFEST.in on LRFutils folder with this content:

include requirements.txt

Link to official documentation

Upvotes: 2

CYCNO
CYCNO

Reputation: 86

it because requirements.txt is in another folder

for running your requiremnets.txt you need to go inside the folder

in your case it is LRFutils foder

so you need to go inside the LRFutils folder by doing

cd LRFutils

then run

pip install -r requirements.txt

hope it's work

Upvotes: 0

Related Questions