IntelligenceX / SDK

Public SDK for Intelligence X
https://intelx.io
405 stars 93 forks source link

Solve Issue #561. error: [Errno 2] No such file or directory: 'script… #562

Closed iherreral closed 2 months ago

iherreral commented 2 months ago

When you try to install the python SDK by following these steps:

git clone https://github.com/intelligencex/sdk
cd sdk/Python
pip3 install -r requirements.txt
pip3 install .

You get the following error:

0 46.86 Building wheels for collected packages: intelx

0 46.86 Building wheel for intelx (pyproject.toml): started

0 47.93 Building wheel for intelx (pyproject.toml): finished with status 'error'

0 47.96 error: subprocess-exited-with-error

0 47.96

0 47.96 × Building wheel for intelx (pyproject.toml) did not run successfully.

0 47.96 │ exit code: 1

0 47.96 ╰─> [17 lines of output]

0 47.96 running bdist_wheel

0 47.96 running build

0 47.96 running build_py

0 47.96 creating build

0 47.96 creating build/lib

0 47.96 copying intelx/intelxapi.py -> build/lib

0 47.96 copying intelx/intelx_identity.py -> build/lib

0 47.96 running egg_info

0 47.96 writing intelx/intelx.egg-info/PKG-INFO

0 47.96 writing dependency_links to intelx/intelx.egg-info/dependency_links.txt

0 47.96 writing requirements to intelx/intelx.egg-info/requires.txt

0 47.96 writing top-level names to intelx/intelx.egg-info/top_level.txt

0 47.96 reading manifest file 'intelx/intelx.egg-info/SOURCES.txt'

0 47.96 writing manifest file 'intelx/intelx.egg-info/SOURCES.txt'

0 47.96 running build_scripts

0 47.96 creating build/scripts-3.8

0 47.96 error: [Errno 2] No such file or directory: 'scripts/intelx.py'

0 47.96 [end of output]

0 47.96

0 47.96 note: This error originates from a subprocess, and is likely not a problem with pip.

0 47.97 ERROR: Failed building wheel for intelx

This is solved by modifying the pyproject.toml file updating the reference to the correct path cli/intelx.py

iherreral commented 2 months ago

https://github.com/IntelligenceX/Python/tree/main/scripts was renamed to scripts from cli due to the scripts keyword from the prior setup.py

This is resolved with git mv cli scripts

Sorry, but in the https://github.com/intelligencex/sdk/Python repo the cli folder appears.

cmlh commented 2 months ago

@iherreral wrote

Sorry, but in the https://github.com/intelligencex/sdk/Python repo the cli folder appears.

https://github.com/IntelligenceX/SDK/tree/cmlh-Identity/Python/scripts represents what was to be merged back into SDK after rejecting the Git Submodule.

https://github.com/IntelligenceX/SDK/commit/cffd1d40057f14356d577dcf02b414b307fd558f#diff-3ea299e18b216e4e18f002e232266c833a1d9d69cab9af74375773f2523a6e7e is the alternate merge performed by @Kleissner.

There is no PEP which mandates the name for the script directory so bin is also common.

iherreral commented 2 months ago

cmlh

Thank you very much @cmlh, Sorry but my Python knowledge is limited and I didn't understand your answer. I will change our application to clone the Python repository, instead of SDK so that the error is fixed during the build.

cmlh commented 2 months ago

@cmlh wrote:

There is no PEP which mandates the name for the script directory so bin is also common.

Sorry I forgot to add and credit to @Kleissner for pointing this out to me sometime ago, we avoided bin and hence renaming the script to intelx, i.e. removing the .py file extension, would be difficult for an end user to determine at face value if intelx was a binary file or a Python script.