microsoft/artifacts-keyring

Error when installing an artifact within a virtual environment

Closed this issue · 3 comments

Hi,
Thanks for this great package.
Following the instructions provided in the Readme file, I can install a Python package from its private artifact in Azure Devops. However, when I try to repeat the operation from within a virtual environment, I get the following error:

ERROR: Could not find a version that satisfies the requirement my_package (from versions: none)
ERROR: No matching distribution found for my_package

I am on Windows 10. I use Python 3.6.5 and pip 19.2.2.
I created the virtual environment with the built-in "venv" command as follows:

> python -m venv my_virtual_env

Any idea where the error is coming from?
Best,
Pierre-Julien

zooba commented

That error often means that your --index-url setting is not correct, though it may mean that pip needs updating.

When you create a venv, it will use a built-in copy of pip rather than the latest available online (so that you can create a venv without needing to access the internet), which means you will need to manually update it inside your venv in order to get a supported version. You will also have to install the artifacts-keyring package again inside the venv (this is an unfortunate aspect of how venv's are designed I'm afraid, there's no real way around it right now :( ).

If you've updated the pip inside your virtual environment to 19.2.2 and installed the package already, check the index url you are providing, and try running the install again with the -v flag to see more information on what it's trying to access (or use -vv or -vvv if you don't see enough information). Sharing that output will help, but it may include personally identifiable information - @salvmd might have a way for you to send that directly to him without having to put it all on the internet.

Yes, I updated the pip version to 19.2.2 and installed the artifacts-keyring package inside the virtual environment. To install that package inside the virtual environment, I had to pass the --user options. Otherwise, it would throw the following error:

ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'c:\\users\\me\\onedrive - mycompany\\python\\test_azure_artefacts_keyring\\env\\Lib\\site-packages\\artifacts_keyring\\plugins\\plugins\\netcore\\CredentialProvider.Microsoft\\runtimes\\unix\\lib\\netstandard1.3\\System.Security.Cryptography.ProtectedData.dll'

Hey,

Closing due to inactivity, please reopen this if it is still an issue.