14 Sep 2024
08:32 PM
- last edited on
16 Sep 2024
09:45 AM
by
MaciejNeumann
Hi guys,
Trying to compile EF2 code which need to import pyodbc and receiving the follow error
{
"error": [
"ERROR: Could not find a version that satisfies the requirement pyodbc (from matrix-boi-dbquery) (from versions: none)",
"ERROR: No matching distribution found for pyodbc",
"Traceback (most recent call last):",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\runpy.py\", line 196, in _run_module_as_main",
" return _run_code(code, main_globals, None,",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\runpy.py\", line 86, in _run_code",
" exec(code, run_globals)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\Scripts\\dt-sdk.exe\\__main__.py\", line 7, in <module>",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\typer\\main.py\", line 338, in __call__",
" raise e",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\typer\\main.py\", line 321, in __call__",
" return get_command(self)(*args, **kwargs)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\click\\core.py\", line 1157, in __call__",
" return self.main(*args, **kwargs)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\typer\\core.py\", line 728, in main",
" return _main(",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\typer\\core.py\", line 197, in _main",
" rv = self.invoke(ctx)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\click\\core.py\", line 1688, in invoke",
" return _process_result(sub_ctx.command.invoke(sub_ctx))",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\click\\core.py\", line 1434, in invoke",
" return ctx.invoke(self.callback, **ctx.params)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\click\\core.py\", line 783, in invoke",
" return __callback(*args, **kwargs)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\typer\\main.py\", line 703, in wrapper",
" return callback(**use_params)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\dynatrace_extension\\cli\\main.py\", line 114, in build",
" wheel(extension_dir, extra_platforms, extra_index_url, find_links)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\dynatrace_extension\\cli\\main.py\", line 227, in wheel",
" run_process(command, cwd=extension_dir)",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\dynatrace_extension\\cli\\main.py\", line 410, in run_process",
" return subprocess.run(command, cwd=cwd, env=env, check=True) # noqa: S603",
" File \"C:\\Users\\yosin\\AppData\\Local\\Programs\\Python\\Python310\\lib\\subprocess.py\", line 526, in run",
" raise CalledProcessError(retcode, process.args,",
"subprocess.CalledProcessError: Command '['C:\\\\Users\\\\yosin\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python310\\\\python.exe', '-m', 'pip', 'download', '-d', 'extension/lib', '--only-binary=:all:', '--platform', 'linux_x86_64', '.']' returned non-zero exit status 1.",
""
],
"detailedOutput": [
"+"
]
}
Python is 3.10.11 and pyodbc is 5.1.0
Running python code that utilize pyodbc from vscode works with no issue
Any suggestion what is wrong here?
Thanks
Yos
Solved! Go to Solution.
14 Sep 2024 09:28 PM
Hi Yos,
I had the same issue and found when you compile your code on windows when it tries to download the Linux module as well it doesn’t find a version supported.
To get around this you need to specific only the windows version by setting the python enviorment to win_amd64 and mine then was able to build and deploy.
https://developer.dynatrace.com/develop/dynatrace-extensions-vscode/settings/#python-environment
Kind regards
Brett
14 Sep 2024 09:43 PM - edited 14 Sep 2024 09:49 PM
Thanks @brett_schubach1
Adding win_amd64 to the setting solve the issue !
All the best and stay safe
Yos
23 Dec 2025 03:23 AM - edited 23 Dec 2025 03:45 AM
Hello Brett,
Working on a Dynatrace Python Extension SDK, I intend using pyodbc Python package.
I am getting the same output as Yos, and I followed the settings of the VS Code as you and Yos suggested, but unfortunately no changes, no successful build.
I restarted the VS Code, still the same exception output.
"Error during python build phase: ERROR: Could not find a version that satisfies the requirement pyodbc (from td-mssqlserver-enrichment) (from versions: none) ERROR: No matching distribution found for pyodbc Traceback (most recent call last): File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code ..."
Please, let me know if you have any other workaround.
Thanks,
Chris
24 Dec 2025 12:28 AM - edited 24 Dec 2025 12:28 AM
You need to build your extension on python 3.10 if you want to use native libraries.
Please take a look at the whl files in your extension lib folder, if they are not targeting python 3.10 for the architecture of the AG/OA you are not using a compatible python version or OS architecture/flag to build the extension
24 Dec 2025 12:44 AM - edited 24 Dec 2025 12:47 AM
All good. I have already used Python 3.10. Thanks for the reply.
It looks like something is not working as expected by using the VS Code option Dynatrace extensions: Build, which keeps throwing that exception.
Instead, I used the command dt-sdk build, downloading and building the dependencies, including pyodbc, creating the extension.zip, and signing it with stored developer certificate file. Then I used Dynatrace extensions: Upload VS Code option, uploading the extension to the tenant. Everything is back on track 😊
Featured Posts