question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to add packages from a private registry

See original GitHub issue
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Pop_OS! 19.10

  • Poetry version: 1.0.3

  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

Poetry fails to install a package from a private repository.

[EnvCommandError]
Command ['/home/remco/.cache/pypoetry/virtualenvs/[venv]-py3.7/bin/pip', 'install', '--no-deps', '--index-url', 'https://[username]:@pypi.fury.io/[org]', '--extra-index-url', 'https://pypi.org/', 'dc-patsy==0.1.3'] errored with the following return code 1, and output: 
Looking in indexes: https://pypi.fury.io/[org], https://pypi.org/
Collecting [package]==0.1.3
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/[package]/

Traceback (most recent call last):
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/console/commands/install.py", line 63, in handle
    return_code = installer.run()
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/installation/installer.py", line 286, in _do_install
    self._execute(op)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/installation/installer.py", line 302, in _execute
    getattr(self, '_execute_{}'.format(method))(operation)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/installation/installer.py", line 327, in _execute_install
    self._installer.install(operation.package)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/installation/pip_installer.py", line 97, in install
    self.run(*args)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/installation/pip_installer.py", line 123, in run
    return self._env.run_pip(*args, **kwargs)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/utils/env.py", line 843, in run_pip
    return self._run(cmd, **kwargs)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/utils/env.py", line 1071, in _run
    return super(VirtualEnv, self)._run(cmd, **kwargs)
  File "/home/remco/.local/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/utils/env.py", line 875, in _run
    raise EnvCommandError(e, input=input_)

The following command does work:

poetry run pip install --no-deps --index-url https://[username]:@pypi.fury.io/[org] [package]==0.1.3

I have manually modified the lockfile, so it refers to the correct registry for this package. However, poetry still adds https://pypi.org/ as an --extra-index-url.

I believe the fix would be to remove the default --extra-index-url. I believe this conflicts with the idea of having a lockfile anyway.

This is similar to #1942, but that issue describes a bug for poetry add instead of poetry install, and the workaround described there doesn’t work for me.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jonapichcommented, Apr 9, 2020

@billkouts That happened to me a while ago when trying to resolve a very old boto3 version. Adding some constraints to the packages made everything much faster.

1reaction
mrosalescommented, Mar 25, 2020

I commented on this other issue: https://github.com/python-poetry/poetry/issues/2178#issuecomment-604057579

I had a similar problem and it seemed to come from the fact that my system pip was outdated. poetry install began working after running poetry run pip install -U pip setuptools wheel to upgrade my packaging utilities.

I think that there needs to be a way to specify a pip version requirement for poetry install

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to install package from private npm registry
I've created a single private project that I'm only using as a centralized, remote NPM package repository. I'm able to publish packages ok....
Read more >
npm install of private package fails when package has public ...
It appears as though npm is searching within my private repository for all the dependencies my-package requires when I specify the --registry ......
Read more >
Private package support - Renovate Docs
Renovate App with a private registry: Add an unencrypted npmrc plus an encrypted npmToken in config. These approaches are described in full below....
Read more >
Troubleshoot login to registry - Azure Container Registry
Symptoms, causes, and resolution of common problems when logging into an Azure container registry.
Read more >
Pull an Image from a Private Registry - Kubernetes
This page shows how to create a Pod that uses a Secret to pull an image from a private container image registry or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found