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:
- Created 4 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
@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.
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 runningpoetry 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