Open inimaz opened 2 months ago
Exact line in my repo that triggers this error https://github.com/inimaz/vscode-extension-codecarbon/blob/main/bundled/tool/lsp_server.py#L210 . This line imports codecarbon
, codecarbon
imports pandas
and pandas
imports numpy
==> the error appears
@inimaz You will need to use platform specific builds. The template was designed with universal builds in mind. But, for scenarios like this where you need platform specific binaries like with numpy, you will need to change the build steps to install numpy
with the binaries. You will also need to change packaging the vsix
to use platform target (see vsce
command line for more details)
Here is an 3rd party extension that builds and ships native binaries based on this template. https://github.com/astral-sh/ruff-vscode
Thanks for the response and the link! @karthiknadig
I agree I will need to do this platform specific builds. Thanks for the tip! It does not solve this problem though, in my case it is the same platform (Windows laptop) just changing the python version. Do I need to do a full matrix of builds per platform per python version?
For example if I support windows and mac, and python 3.7 and python 3.8... Do I need to do:
You will have to pull the native builds for each python ABI (i.e, py37, py38, py39, etc) at build time if you want to package it.
We do this for debugpy
, in the python debugger extension. We pull each of the compiled variants for the debugger.
Hello team,
thanks for this template! I am building an extension using this template, see the repo. And it works, but only if the python version is the same as the python version used when it was built.
If it is not the case, when the user's python (python 3.12) has not the same version as the one that built it (python 3.11). I get the following error from
numpy
:What do you think I should do? Build an extension per python version and then detect which one to load?
Thanks!