Poetry could not find a matching version of package in windows
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 (
-vvvoption).
- OS version and name: Windows 10 Enterprise 19041.746
- Poetry version: 1.1.4
- Link of my super simple Gist with the contents of my super simple pyproject.toml file:
Issue
I am trying to install a python package in a private repo. The following command works
pip install --extra-index-url private-repo/simple private-package
Which tells me that it’s not a permissions issue
If I try to use poetry from a clean project
- poetry new debug
- add the private-repo to the pyproject.toml
- run poetry add -vvv private-package
I get the following
6 ~\.poetry\lib\poetry\_vendor\py3.8\clikit\console_application.py:131 in run
129│ parsed_args = resolved_command.args
130│
→ 131│ status_code = command.handle(parsed_args, io)
132│ except KeyboardInterrupt:
133│ status_code = 1
5 ~\.poetry\lib\poetry\_vendor\py3.8\clikit\api\command\command.py:120 in handle
118│ def handle(self, args, io): # type: (Args, IO) -> int
119│ try:
→ 120│ status_code = self._do_handle(args, io)
121│ except KeyboardInterrupt:
122│ if io.is_debug():
4 ~\.poetry\lib\poetry\_vendor\py3.8\clikit\api\command\command.py:171 in _do_handle
169│ handler_method = self._config.handler_method
170│
→ 171│ return getattr(handler, handler_method)(args, io, self)
172│
173│ def __repr__(self): # type: () -> str
3 ~\.poetry\lib\poetry\_vendor\py3.8\cleo\commands\command.py:92 in wrap_handle
90│ self._command = command
91│
→ 92│ return self.handle()
93│
94│ def handle(self): # type: () -> Optional[int]
2 ~\.poetry\lib\poetry\console\commands\add.py:107 in handle
105│ return 0
106│
→ 107│ requirements = self._determine_requirements(
108│ packages,
109│ allow_prereleases=self.option("allow-prereleases"),
1 ~\.poetry\lib\poetry\console\commands\init.py:328 in _determine_requirements
326│ elif "version" not in requirement:
327│ # determine the best version automatically
→ 328│ name, version = self._find_best_version_for_package(
329│ requirement["name"],
330│ allow_prereleases=allow_prereleases,
ValueError
Could not find a matching version of package private-package
at ~\.poetry\lib\poetry\console\commands\init.py:367 in _find_best_version_for_package
363│ )
364│
365│ if not package:
366│ # TODO: find similar
→ 367│ raise ValueError(
368│ "Could not find a matching version of package {}".format(name)
369│ )
370│
371│ return package.pretty_name, selector.find_recommended_require_version(package)
Thank you for reading my issue and for helping to develop poetry ❤️
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
poetry can't find version of dependency even though it exists
ERROR: No matching distribution found for... The distribution for that version is available at pypa, and is often the most recent version.
Read more >Basic usage | master | Documentation | Poetry - Python ...
To update to the latest versions, use the update command. This will fetch the latest matching versions (according to your pyproject.toml file) and...
Read more >Why you should use Poetry instead of Pip or Conda for Python ...
This article from Real Python gives a pretty good description how one could get started with Pip. Poetry: Poetry is a newer dependency ......
Read more >Dependency Management With Python Poetry
When your Python project relies on external packages, you need to make sure you're using the right version of each package.
Read more >poetry - PyPI
Python dependency management and packaging made easy. ... [tool.poetry] name = "my-package" version = "0.1.0" description = "The description of the package" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You do not have the same issue. Your issue seems to me like an error in the command line. You would need to do
poetry add git+ssh://.... Note how I removed the singlemy-repoand went straight to the git URI.Check the doc: https://python-poetry.org/docs/cli/#add
Sometimes, the
import <NAME>isn’t the same aspip install <NAME>/poetry add <NAME>.Example:
Install / Poetry:
It’s convention that the import name is the same as the install name - which isn’t always the case.
This is because
installnames must be unique, but import names don’t actually have to be, since we can add an alias: