Issue while trying to deploy model on Heroku - python

I am deploying a python ML model using Flask on Heroku. Here is GitHub link with all my procfiles and requirements.txt files https://github.com/shrey10926/ineuron-project/tree/master.
I am first creating my project repository on GitHub and then using Heroku to deploy my model via GitHub option. Below is the traceback:-
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.9/site-
packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/app/.heroku/python/lib/python3.9/site-
packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/app/.heroku/python/lib/python3.9/site-
packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/tmp/pip-build-env-mmu23e6l/overlay/lib/python3.9/site-
packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
self.run_setup()
File "/tmp/pip-build-env-mmu23e6l/overlay/lib/python3.9/site-
packages/setuptools/build_meta.py", line 258, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-mmu23e6l/overlay/lib/python3.9/site-
packages/setuptools/build_meta.py", line 150, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 583, in <module>
setup_package()
File "setup.py", line 579, in setup_package
setup(**metadata)
File "/tmp/pip-build-env-mmu23e6l/overlay/lib/python3.9/site-
packages/numpy/distutils/core.py", line 137, in setup
config = configuration()
File "setup.py", line 477, in configuration
raise NotFoundError(msg)
numpy.distutils.system_info.NotFoundError: No lapack/blas resources found.
----------------------------------------
ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python
/app/.heroku/python/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py
prepare_metadata_for_build_wheel /tmp/tmphdo6r3ju Check the logs for full command output.
! Push rejected, failed to compile Python app.
! Push failed

Everything looks fine. I checked your Github repository then I realized that your main branch is empty while your master branch is ok. Check your Heroku configuration is what branch is used for. (main/master ?). It might be based on the main branch.
https://dashboard.heroku.com/apps/your-app-name/deploy/github

Related

Building wheel for numpy (pyproject.toml) ... error

I have created a python app in my namecheap cpanel. I uploaded by server files in that and also UI files in public_html. However, I was getting Internal Server Error 500. Then I contacted their customer service. They told me install joblib through terminal. I installed it. Then they said in my root folder a file named "stderr.log" it said numpy is missing. So I tried to install numpy. But it shows the following error. Even customer service person failed to provide a solution. When I try pip install numpy, it shows the following large error. Please help.
Building wheels for collected packages: numpy
Building wheel for numpy (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for numpy (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [61 lines of output]
Running from numpy source directory.
setup.py:67: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
import numpy.distutils.command.sdist
Traceback (most recent call last):
File "/opt/alt/python39/lib64/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/alt/python39/lib64/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/pip-build-env-r6jq5if_/overlay/lib64/python3.9/site-packages/cython.py", line 16, in <module>
from Cython.Compiler.Main import main
File "/tmp/pip-build-env-r6jq5if_/overlay/lib64/python3.9/site-packages/Cython/Compiler/Main.py", line 28, in <module>
from .Scanning import PyrexScanner, FileSourceDescriptor
ImportError: /tmp/pip-build-env-r6jq5if_/overlay/lib64/python3.9/site-packages/Cython/Compiler/Scanning.cpython-39-x86_64-linux-gnu.so: failed to map segment from shared object: Operation not permitted
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_pcg64.pyx
Traceback (most recent call last):
File "/tmp/pip-install-q0hfnoqk/numpy_6a92dfb088184f0aaac1f9f1f3acc80e/tools/cythonize.py", line 205, in <module>
main()
File "/tmp/pip-install-q0hfnoqk/numpy_6a92dfb088184f0aaac1f9f1f3acc80e/tools/cythonize.py", line 201, in main
find_process_files(root_dir)
File "/tmp/pip-install-q0hfnoqk/numpy_6a92dfb088184f0aaac1f9f1f3acc80e/tools/cythonize.py", line 192, in find_process_files
process(root_dir, fromfile, tofile, function, hash_db)
File "/tmp/pip-install-q0hfnoqk/numpy_6a92dfb088184f0aaac1f9f1f3acc80e/tools/cythonize.py", line 158, in process
processor_function(fromfile, tofile)
File "/tmp/pip-install-q0hfnoqk/numpy_6a92dfb088184f0aaac1f9f1f3acc80e/tools/cythonize.py", line 47, in process_pyx
subprocess.check_call(
File "/opt/alt/python39/lib64/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/nahiuzfc/virtualenv/classify_image/3.9/bin/python3.9_bin', '-m', 'cython', '-3', '--fast-fail', '-o', '_pcg64.c', '_pcg64.pyx']' returned non-zeroexit status 1.
Cythonizing sources
Traceback (most recent call last):
File "/home/nahiuzfc/virtualenv/classify_image/3.9/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/nahiuzfc/virtualenv/classify_image/3.9/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/nahiuzfc/virtualenv/classify_image/3.9/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-r6jq5if_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 230, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/tmp/pip-build-env-r6jq5if_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-r6jq5if_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-r6jq5if_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 479, in <module>
setup_package()
File "setup.py", line 458, in setup_package
generate_cython()
File "setup.py", line 261, in generate_cython
raise RuntimeError("Running cythonize failed!")
RuntimeError: Running cythonize failed!
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

"error: subprocess-exited-with-error" returned when running "pip install win32core"

I keep trying to install the win32core so virtualbox will stop yelling at me when I run the install, but after running "pip install win32core" (which I was informed should work) it returned all this:
Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\[my user]\AppData\Local\Temp\pip-build-env-dnb2bcv9\overlay\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\[my user]\AppData\Local\Temp\pip-build-env-dnb2bcv9\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "C:\Users\[my user]\AppData\Local\Temp\pip-build-env-dnb2bcv9\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\[my user]\AppData\Local\Temp\pip-build-env-dnb2bcv9\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 56, in <module>
File "C:\Users\[my user]\AppData\Local\Temp\pip-install-ddycyrfm\win32core_958a160db78445ecbd19f6afc5f87336\win32\distutils\util.py", line 51, in collect_extensions
cfg = yaml.load(fh)
TypeError: load() missing 1 required positional argument: 'Loader'
The issue is I don't completely understand how to fix this, because I'm more new to getting stuff like this working.
It also spits out a little note:
note: This error originates from a subprocess, and is likely not a problem with pip.
I've tried digging in other forums, never came up with actual answers.

"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 🤔
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.
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

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-g22gfh_9/lazy-object-proxy/ on jetson nano

enter link description here
i follow this youtuber try to install Visual Studio Code on jetson nano
This happened when I used this command:./installVSCodeWithPython.sh,i recieve this:
by the way the link of youtube is up,English is not very good, please forgive me!
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-g22gfh_9/lazy-object-proxy/setup.py", line 146, in <module>
distclass=BinaryDistribution,
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 372, in __init__
_Distribution.__init__(self, attrs)
File "/usr/lib/python3.6/distutils/dist.py", line 281, in __init__
self.finalize_options()
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 528, in finalize_options
ep.load()(self, ep.name, value)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/tmp/pip-build-g22gfh_9/lazy-object-proxy/.eggs/setuptools_scm-7.0.5-py3.6.egg/setuptools_scm/__init__.py", line 5
from __future__ import annotations
^
SyntaxError: future feature annotations is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-g22gfh_9/lazy-object-proxy/
Collecting black*
If there is more information needed, I will provide Thanks in advance!
According to this issue. This seems to be caused by the incorrect selection of the Python interpreter. However, you are currently in the process of installing vscode, which seems to be a mixed error. I think it is more reasonable to change the download method.
You can refer to the docs for details about installing vscode and python. It's more official.
Here is the download page on vscode and python.

Trying to install scikit-learn shows comman exit out with error status 1

I am trying to install the sklearn package and it does not work. I have numpy installed as well as scipy and have tried updating installing tools. I'm using Pycharm on Python 3.10. This is the error message that shows up
PS C:\Users\jason\PycharmProjects\pythonProject> pip install scikit-learn
Collecting scikit-learn
Using cached scikit-learn-1.0.1.tar.gz (6.6 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\jason\pycharmprojects\pythonproject\venv\scripts\python.exe' 'c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pe
p517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\jason\AppData\Local\Temp\tmplhn1abe4'
cwd: C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80
Complete output (46 lines):
Partial import of sklearn during the build process.
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
Traceback (most recent call last):
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 164, in prepare_metadata_for_build_w
heel
return hook(metadata_directory, config_settings)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 319, in <module>
setup_package()
File "setup.py", line 315, in setup_package
setup(**metadata)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
File "setup.py", line 201, in configuration
config.add_subpackage("sklearn")
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 1016, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 982, in get_subpackage
config = self._get_configuration_from_setup_py(
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 924, in _get_configuration_from_setup
_py
config = setup_module.configuration(*args)
File "sklearn\setup.py", line 85, in configuration
cythonize_extensions(top_path, config)
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\__init__.py", line 47, in cythoniz
e_extensions
basic_check_build()
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\pre_build_helpers.py", line 113, i
n basic_check_build
compile_test_program(code)
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\pre_build_helpers.py", line 70, in
compile_test_program
ccompiler.compile(
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 323, in compile
self.initialize()
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 220, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\msvc.py", line 316, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\msvc.py", line 270, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.c
om/visual-cpp-build-tools/
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/62/7c/596ff7b32f655f379d3abdfa82607e5cb3b70f46baad4604706511cfeb85/scikit-learn-1.0.1.tar.gz#sha256=ac2ca9
dbb754d61cfe1c83ba8483498ef951d29b93ec09d6f002847f210a99da (from https://pypi.org/simple/scikit-learn/) (requires-python:>=3.7). Command errored out with exit status
1: 'c:\users\jason\pycharmprojects\pythonproject\venv\scripts\python.exe' 'c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_p
rocess\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\jason\AppData\Local\Temp\tmplhn1abe4' Check the logs for full command output.
I faced the same problem with having python 3.10.1 installed in my system (fedora35). This error occured both in my os and virtual environment. Later I installed python3.7 and from venv I could install scikit-learn.Try installing scikit-learn from different python version, which should work.
Same problem here.
noted that scilean only supported by python 2.7, 2.8 and 2.9.
so just downgrade python to 2.8 then reinstall scilearn.

Categories

Resources