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