Error when deploying app on azure app service - python

I get this error message when I deploy my app from github to the azure app service.
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
Package libparted was not found in the pkg-config search path.
Perhaps you should add the directory containing `libparted.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libparted' found
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/tmp/pip-install-duf5fzoq/pyparted_8a4ebfd316a743d7b84f7e1e0c77cc80/setup.py", line 60, in
check_mod_version('libparted', need_libparted_version)
File "/tmp/pip-install-duf5fzoq/pyparted_8a4ebfd316a743d7b84f7e1e0c77cc80/setup.py", line 54, in check_mod_version
modversion = subprocess.check_output(["pkg-config", "--modversion", module]).decode('utf-8').split()[0]
File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pkg-config', '--modversion', 'libparted']' 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: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.

This is most likely because you have not installed the package. There are several ways to do this but the easiest is to install via the Kudu console.
The Kudu console gives you direct, elevated command-line access to the App Service server and its file system. This is both a valuable debugging tool and allows for CLI operations such as installing packages.
Use python.exe -m pip install <package_name> to install a package.
Full Instructions are here:
https://learn.microsoft.com/en-us/visualstudio/python/managing-python-on-azure-app-service?view=vs-2022#azure-app-service-kudu-console

Related

Failing to install Sparkmagic using pip

I am trying to install sparkmaic in jupyter notebook through pip but getting below error:
Command:
pip install sparkmagic
error:
Collecting gssapi>=1.6.0
Using cached gssapi-1.8.1.tar.gz (94 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
╰─> [21 lines of output]
/bin/sh: 1: krb5-config: not found
Traceback (most recent call last):
File "/home/e004255/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/e004255/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/e004255/.local/lib/python3.8/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-guoi_e0p/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-guoi_e0p/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-guoi_e0p/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 109, in <module>
File "<string>", line 22, in get_output
File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'krb5-config --libs gssapi' returned non-zero exit status 127.
[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.
It looks like your system is missing a tool named krb5-config. You might be able to install it with:
sudo apt install krb5-config
Thanks #bernhard
but, I had to install dev tools too (ubuntu 20.04).
sudo apt-get install libkrb5-dev

Cannot install Scipy using pip on Windows

I have a Windows computer and I tried installing SciPy in the Command Prompt using pip. pip install ... worked for other packages that I have installed; however, for scipy, it gave me an error. Any help would be great Below is the error message:
C:\Users\mharvest>pip install scipy
Collecting scipy
Using cached scipy-1.9.1.tar.gz (42.0 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
╰─> [55 lines of output]
The Meson build system
Version: 0.62.2
Source dir: C:\Users\mharvest\AppData\Local\Temp\pip-install-jvemq8sw\scipy_46a2c46b25884e73b044795d4031c57c
Build dir: C:\Users\mharvest\AppData\Local\Temp\pip-install-jvemq8sw\scipy_46a2c46b25884e73b044795d4031c57c\.mesonpy-ouof6i1j\build
Build type: native build
Project name: SciPy
Project version: 1.9.1
WARNING: Failed to activate VS environment: Could not parse vswhere.exe output
..\..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
The following exception(s) were encountered:
Running "icl " gave "[WinError 2] The system cannot find the file specified"
Running "cl /?" gave "[WinError 2] The system cannot find the file specified"
Running "cc --version" gave "[WinError 2] The system cannot find the file specified"
Running "gcc --version" gave "[WinError 2] The system cannot find the file specified"
Running "clang --version" gave "[WinError 2] The system cannot find the file specified"
Running "clang-cl /?" gave "[WinError 2] The system cannot find the file specified"
Running "pgcc --version" gave "[WinError 2] The system cannot find the file specified"
A full log can be found at C:\Users\mharvest\AppData\Local\Temp\pip-install-jvemq8sw\scipy_46a2c46b25884e73b044795d4031c57c\.mesonpy-ouof6i1j\build\meson-logs\meson-log.txt
+ meson setup --native-file=C:\Users\mharvest\AppData\Local\Temp\pip-install-jvemq8sw\scipy_46a2c46b25884e73b044795d4031c57c\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 --prefix=C:\Users\mharvest\AppData\Local\Programs\Python\Python311-32 C:\Users\mharvest\AppData\Local\Temp\pip-install-jvemq8sw\scipy_46a2c46b25884e73b044795d4031c57c C:\Users\mharvest\AppData\Local\Temp\pip-install-jvemq8sw\scipy_46a2c46b25884e73b044795d4031c57c\.mesonpy-ouof6i1j\build
Traceback (most recent call last):
File "C:\Users\mharvest\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\mharvest\AppData\Local\Programs\Python\Python311-32\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\mharvest\AppData\Local\Programs\Python\Python311-32\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mharvest\AppData\Local\Temp\pip-build-env-bjmh2uho\overlay\Lib\site-packages\mesonpy\__init__.py", line 923, in get_requires_for_build_wheel
with _project(config_settings) as project:
File "C:\Users\mharvest\AppData\Local\Programs\Python\Python311-32\Lib\contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "C:\Users\mharvest\AppData\Local\Temp\pip-build-env-bjmh2uho\overlay\Lib\site-packages\mesonpy\__init__.py", line 902, in _project
with Project.with_temp_working_dir(
File "C:\Users\mharvest\AppData\Local\Programs\Python\Python311-32\Lib\contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "C:\Users\mharvest\AppData\Local\Temp\pip-build-env-bjmh2uho\overlay\Lib\site-packages\mesonpy\__init__.py", line 547, in with_temp_working_dir
yield cls(source_dir, tmpdir, build_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mharvest\AppData\Local\Temp\pip-build-env-bjmh2uho\overlay\Lib\site-packages\mesonpy\__init__.py", line 463, in __init__
self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
File "C:\Users\mharvest\AppData\Local\Temp\pip-build-env-bjmh2uho\overlay\Lib\site-packages\mesonpy\__init__.py", line 494, in _configure
self._meson(
File "C:\Users\mharvest\AppData\Local\Temp\pip-build-env-bjmh2uho\overlay\Lib\site-packages\mesonpy\__init__.py", line 477, in _meson
return self._proc('meson', *args)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mharvest\AppData\Local\Temp\pip-build-env-bjmh2uho\overlay\Lib\site-packages\mesonpy\__init__.py", line 472, in _proc
subprocess.check_call(list(args))
File "C:\Users\mharvest\AppData\Local\Programs\Python\Python311-32\Lib\subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['meson', 'setup', '--native-file=C:\\Users\\mharvest\\AppData\\Local\\Temp\\pip-install-jvemq8sw\\scipy_46a2c46b25884e73b044795d4031c57c\\.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2', '--prefix=C:\\Users\\mharvest\\AppData\\Local\\Programs\\Python\\Python311-32', 'C:\\Users\\mharvest\\AppData\\Local\\Temp\\pip-install-jvemq8sw\\scipy_46a2c46b25884e73b044795d4031c57c', 'C:\\Users\\mharvest\\AppData\\Local\\Temp\\pip-install-jvemq8sw\\scipy_46a2c46b25884e73b044795d4031c57c\\.mesonpy-ouof6i1j\\build']' 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.
Judging from the traceback you appear to be using 32-bit Python3.11
There are no 32-bit wheels available for scipy-1.9.2. Whilst there are 32-bit wheels available for 1.9.1, but don't target Python 3.11.
Installing a 64 bit Python interpreter should fix this issue. Although Python3.11 hasn't been released yet you can find the 64-bit installer at https://www.python.org/downloads/release/python-3110rc2/
install scipy 1.8.1 version
it's solve my problem install it and if you get "ould not build wheels for scipy which use PEP 517 and cannot be installed directly"
error.
upgrade pip
The important part of the error message is ERROR: Unknown compiler(s), informing us that a C compiler was not found:
..\..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
After you fix this, you're also going to need a C++ compiler, a Fortran compiler, the Python header files, cmake, and a handful of other low-level tools.
TL;DR: Compiling SciPy on Windows is hard. You might follow Andrew Nelson's suggestion to install a 64-bit version of Python and use pip to fetch pre-built wheels. Or you might setup Anaconda/Miniconda for Windows and install SciPy with:
conda install scipy
Further Reading:
"Building NumPy and SciPy on Windows is more difficult ... please do not expect these instructions to be accurate in the long-run ...." (from: Scipy: Building from Source on Windows)
You'll need to install the Microsoft Visual Studio as a prerequisite. If your prompt cannot find cl, "then either you are not using a developer command prompt, or something is wrong with your installation of Visual Studio." (from: Microsoft Windows. Walkthrough: Compile a C program on the command line)

Cannot install PyQt6 in python 3.9. error: metadata-generation-failed and error: subprocess-exited-with-error

This is a new raspberry pi environment with default python 3.9.2. The pip version is 22.0.4. I can install pyqt5, but my project requires pyqt6.
There are two errors always occur: 'error: metadata-generation-failed' and 'error: subprocess-exited-with-error'.
pi#raspberrypi:~ $ pip --version
pythonpip 22.0.4 from /home/pi/.local/lib/python3.9/site-packages/pip (python 3.9)
pi#raspberrypi:~ $ pip install pyqt6
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pyqt6
Using cached PyQt6-6.2.3.tar.gz (1.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [29 lines of output]
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/pi/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/pi/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/tmp/pip-build-env-5inxj2op/overlay/lib/python3.9/site-packages/sipbuild/api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "/tmp/pip-build-env-5inxj2op/overlay/lib/python3.9/site-packages/sipbuild/abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/tmp/pip-build-env-5inxj2op/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 594, in setup
self.apply_user_defaults(tool)
File "project.py", line 67, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-5inxj2op/overlay/lib/python3.9/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-5inxj2op/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 241, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "/tmp/pip-build-env-5inxj2op/overlay/lib/python3.9/site-packages/pyqtbuild/builder.py", line 67, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Any ideas?
This is not a fix but maybe a solution for someone who want to use pyqt6 on Raspberry Pi:
I tried for hours and hours to install PyQt6 on my Raspberry Pi because i developed an application in a virtual machine and wanted to use it on a RP4. I tried with Raspberry Pi OS, Ubuntu 22.10 and PopOS with Python 3.8, 3.9, 3.10 and 3.11 (in venv), but everytime when i used pip install pyqt6 i got this error "metadata generation failed". I installed all the dependecies and side-packages (at least i assume) - nothing worked.
At this point i was sure it had something to do with the architecture (aarch64), but on the other hand i had read that people got it running on RP... Then i discovered that there is a package for Arch-Linux "https://archlinuxarm.org/packages/aarch64/python-pyqt6". I gave it a try.
Flashed my RP4 again and installed Manjaro ARM Gnome 22.12 from Raspberry Pi Imager (v1.7.3).
PyQt5 was already pre installed which made me confident. I installed "python-pyqt6" from the Package Manager and checked optional pyqt6-tools. There are a lot of dependencies which are installed automatically. On first use the Package manager will propably update a lot of packages. This will take a while. PyQt6 will install at the end.
I also had to unset the environment variable QT_QPA_PLATFORM. But then , finally , my pyqt6-application was running on Raspberry PI.
I am currently using Python 3.10.9

installing python module on linux

I am trying to install the python module pyobjus (this is the one that fails to install another module).
But I always get some bug during installation. I tried to switch to other python versions, reinstall pip, use option --no-cache-dir, etc, but couldn't manage to get past this bug:
$ pip3 install pyobjus
Defaulting to user installation because normal site-packages is not writeable
Collecting pyobjus
Using cached pyobjus-1.2.0.tar.gz (165 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf
cwd: /tmp/pip-install-4k26drr5/pyobjus
Complete output (19 lines):
Pyobjus platform is linux
Traceback (most recent call last):
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 150, in get_requires_for_build_wheel
config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 130, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 254, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-35d2l6hi/overlay/lib/python3.6/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 35, in <module>
class PyObjusBuildExt(build_ext, object):
NameError: name 'build_ext' is not defined
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /home/denis/.local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpoff64vmf Check the logs for full command output.
Any help would be greatly appreciated.
My OS is Linux Mint 19.3.
I saw this question which is about the same problem, but following the links did not bring any answer. It says PyObjus is designed for MacOS, but then why does the module katrain, supposedly compatible with linux, tries to install it when running "pip3 install katrain" (giving the same error as above) ?
Edit adter Marat's suggestion:
I removed the test for ios, the installation goes a bit further, but fails because Python.h is missing. when trying to install python3-dev, apt-get says that broken packages such as python3.6-dev are flagged "left as is", so it cannot install the required ones. Is there a way to fix the python installation, which seems to be broken ? I am afraid to break all the system if I mess up with it too much, but there is clearly a problem with my installation...
Fixed the above issue by reinstalling stuff, now it is CoreFoundation.h that is missing...

CANNOT Install external modules in Canopy

I have set Canopy as my default python compiler.
I want to install scikits modules, currently not available in Canopy Package manager. I have installed setup tools and easy_install, pip which points to Canopy installation ( which easy_install -> Canopy directory). But I cannot use either of them to download any of the above modules.
More specifically fetching scikits.odes gives me this error log:
Cleaning up...
Removing temporary dir /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick/scikits.odes
Exception information:
Traceback (most recent call last):
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/basecommand.py", line 134, in main
status = self.run(options, args)
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/commands/install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 1134, in prepare_files
req_to_install.run_egg_info()
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/req.py", line 259, in run_egg_info
command_desc='python setup.py egg_info')
File "/Users/nick/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/util.py", line 670, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /private/var/folders/b3/cvy2g4393534zjsrgxgnmvch0000gn/T/pip_build_nick/scikits.odes
Similar error logs were thrown for the other module installation attempts I had made.
Any suggestions? How can I fix this obvious bug?
I suspect that by installing setuptools, you have corrupted the version of easy_install that is already included in in the distribute package, which is part of Canopy. I have updated this article to emphasize this caution.
Please delete your Canopy User Python directory, /Users/nick/Library/Enthought/Canopy_64bit/User/ and restart Canopy to re-create it without the conflicting version of setuptools. Then easy_install pip from terminal, and try again.
I am not sure if this will suffice, but it will be a step at least.

Categories