microsoft / artifacts-keyring

Keyring backend for Azure Artifacts
MIT License
32 stars 18 forks source link

Broken on linux - can't find dotnet runtime even though it's installed #34

Closed pjanowski closed 3 years ago

pjanowski commented 3 years ago

artifacts-keyring always worked on linux for me but recent pip installs don't work with this message

WARNING: Keyring is skipped due to an exception: Unable to find dependency dotnet, please manually install the .NET Core runtime and ensure 'dotnet' is in your PATH. Error: [Errno 2] No such file or directory: 'dotnet': 'dotnet'

This happens on linux both with and without dotnet runtime installed. In the past it would work in both cases and now fails in both.

The issue seems to be coming from this change https://github.com/microsoft/artifacts-keyring/pull/31 it no longer works. Specifically, this

sys_version = tuple(int(i) for i in subprocess.check_output(["dotnet", "--version"]).decode().strip().partition("-")[0].split("."))

fails because dotnet --version does not work on linux even when dotnet runtimes are installed.

zooba commented 3 years ago

What's the command on Linux? Is it a single hyphen option?

pjanowski commented 3 years ago

In my case, something like this:

pip install keyring artifacts-keyring
pip install aml-ds-pipeline-contrib==0.0.0rc5 --extra-index-url=https://pkgs.dev.azure.com/msdata/Vienna/_packaging/aml-ds%40Local/pypi/simple/ --extra-index-url https://azuremlsdktestpypi.azureedge.net/modulesdkpreview
daviwu commented 3 years ago

I installed dotnet 5 on ubuntu and artifacts-keyring seems to be working. You need to make sure that dotnet --version is working on your machine.

tl24 commented 3 years ago

Having similar issues here. "dotnet --version" only works if an SDK is installed. If all you have is the runtime it will fail (per this article: https://github.com/dotnet/dotnet-docker/issues/2235). I think either the code needs to switch to using "dotnet --info" if it doesn't actually need the sdk, or change the documentation to specify that the dotnet sdk is required.

pjanowski commented 3 years ago

Exactly @daviwu : dotnet --version does not work unless you have sdk installed. We need to make that an explicit requirement, but that seems excessive. So why not fix the code so it runs with only dotnet runtimes installed per @tl24 suggestion.

Divjyot commented 3 years ago

After lot of painful 'days', I found this combination python -m pip install --user dotnetcore2==2.1.11 artifacts-keyring==0.2.10 works for installing private packages. I hope this issue gets fixed soon.

I am running this inside Docker (based on Ubuntu 18.04)

justvanrossum commented 3 years ago

python -m pip install --user dotnetcore2==2.1.11 artifacts-keyring==0.2.10

This 'fixed' it for me on macOS. Thanks!

github-actions[bot] commented 3 years ago

In order to consolidate to fewer feedback channels, we've moved suggestions and issue reporting to Developer Community.

rgammans commented 3 years ago

Could you link to the actual issue in the dev community, so other can follow the discussion