Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14215

raise DistutilsError(str(e)) from e distutils.errors.DistutilsError

$
0
0

I've made a recommendation system using python 3.9.2 using surprise library. Then my employer asked if i could make a website demonstrating the recommendation system. So I made one using flask. The problem is when I wanted to deploy the python 3.9 flask app on apache server it gave me 7024 error - incorrect function. But when I followed the same steps using python 3.12 it worked just fine and the app ran. However, the recommendation function throws an error as the surprise library is not installed. When I try to install it, the following error occurrs.

Collecting surprise  Using cached surprise-0.1-py2.py3-none-any.whl.metadata (327 bytes)Collecting scikit-surprise (from surprise)  Using cached scikit-surprise-1.1.3.tar.gz (771 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╰─> [60 lines of output]<string>:65: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.      !!              ********************************************************************************                  Requirements should be satisfied by a PEP 517 installer.              If you are using pip, you can try `pip install --use-pep517`.              ********************************************************************************          !!      WARNING: The wheel package is not available.      D:\flaskApp\env\Scripts\python.exe: No module named pip      Traceback (most recent call last):        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\installer.py", line 101, in _fetch_build_egg_no_warn          subprocess.check_call(cmd)        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 413, in check_call          raise CalledProcessError(retcode, cmd)      subprocess.CalledProcessError: Command '['D:\\flaskApp\\env\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpx2euatq3', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.      The above exception was the direct cause of the following exception:      Traceback (most recent call last):        File "D:\flaskApp\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>          main()        File "D:\flaskApp\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main          json_out['return_val'] = hook(**hook_input['kwargs'])                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^        File "D:\flaskApp\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel          return hook(config_settings)                 ^^^^^^^^^^^^^^^^^^^^^        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel          return self._get_build_requires(config_settings, requirements=['wheel'])                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires          self.run_setup()        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup           super().run_setup(setup_script=setup_script)        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup           exec(code, locals())        File "<string>", line 65, in <module>        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\dist.py", line 640, in fetch_build_eggs          return _fetch_build_eggs(self, requires)                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\installer.py", line 38, in _fetch_build_eggs          resolved_dists = pkg_resources.working_set.resolve(                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\pkg_resources\__init__.py", line 798, in resolve            dist = self._resolve_dist(                 ^^^^^^^^^^^^^^^^^^^        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\pkg_resources\__init__.py", line 834, in _resolve_dist          dist = best[req.key] = env.best_match(                                 ^^^^^^^^^^^^^^^        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\pkg_resources\__init__.py", line 1104, in best_match          return self.obtain(req, installer)                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\pkg_resources\__init__.py", line 1115, in obtain            return installer(requirement) if installer else None        File "C:\Users\user\AppData\Local\Temp\pip-build-env-kkvji2sx\overlay\Lib\site-packages\setuptools\installer.py", line 103, in _fetch_build_egg_no_warn          raise DistutilsError(str(e)) from e      distutils.errors.DistutilsError: Command '['D:\\flaskApp\\env\\Scripts\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpx2euatq3', '--quiet', 'numpy>=1.17.3']' returned non-zero exit status 1.      [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`

I have tried reinstalling python3.12 and updating pip. I also tried to search what is the building wheels but couldn't find out what the problem is. Regarding python 3.9 I have searched forever to identify the problem with apache on my local computer but did also not find any solution.


Viewing all articles
Browse latest Browse all 14215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>