Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry cannot find and install package with 0.???a (alpha/beta designation) in its version #824

Closed
1 of 3 tasks
amal-khailtash opened this issue Jan 22, 2019 · 10 comments
Closed
1 of 3 tasks

Comments

@amal-khailtash
Copy link

  • 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: Oracle Linux Server 7.5

  • Poetry version: 0.12.11

  • Link of a Gist with the contents of your pyproject.toml file: Proprietary!

Issue

When trying to add "bit-vector" package, I get this error:

$ poetry add bit-vector
                                                        
[ValueError]                                
Could not find a matching version of package bit-vector  

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

poetry search bit-vector shows:

bit-vector (0.42a0)
 A BitVector class for Python

Editing the .toml file and adding 'bit-vector = "0.26a0"' works, but poetry show --outdated does not show new "0.42a0" version nor, poetry update updates to this version.

@amal-khailtash amal-khailtash changed the title Poetry cannot find and install package with 0.??? in its version Poetry cannot find and install package with 0.???a (alpha/beta designation) in its version Jan 22, 2019
@amal-khailtash
Copy link
Author

The problem seems to be with packages with a/b. ... (alpha/beta) designation. The same thing happens with sty.

Search:

$ poetry search sty
sty (1.0.0b8)

Add:

$ poetry add sty

[ValueError]                         
Could not find a matching version of package sty  

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

This works:

$ poetry add sty="1.0.0b8"
Updating dependencies
Resolving dependencies... (2.3s)

Package operations: 1 install, 0 updates, 0 removals

Writing lock file

  - Installing sty (1.0.0b8)

@woile
Copy link

woile commented Jan 27, 2019

Have you tried adding the --allow-prereleases flag?

@amal-khailtash
Copy link
Author

I commented the following in the pyproject.toml:

# bit-vector = "0.42a0"

And ran add with --allow-prereleases, and I see:

$ poetry add --allow-prereleases bit-vector-vector
Using version ^0.10.0-alpha.0 for bit-vector

Updating dependencies
Resolving dependencies... (4.8s)


Package operations: 0 installs, 1 update, 0 removals

Writing lock file

  - Updating bit-vector (0.42a0 -> 0.11a0)

I also see this line in pyproject.toml:

bit-vector = {version = "^0.10.0-alpha.0",allows-prereleases = true}

I am not sure why it does not pick the newer version: "0.42a0"!

@amal-khailtash
Copy link
Author

amal-khailtash commented Jan 27, 2019

Adding the specific version works though:

$ poetry add --allow-prereleases bit-vector="^0.42.0a0"

Not sure if this is expected, but this does not work:

$ poetry add --allow-prereleases sty="^1.0.0"

But this works:

$ poetry add --allow-prereleases sty="^1.0.0a9"

@amal-khailtash
Copy link
Author

Apparently either of the following:

bit-vector = {version = "^0.42.0a0",allows-prereleases = true}
bit-vector = "0.42a0"

causes a hang that I reported in issue #832

@pawamoy
Copy link

pawamoy commented Jan 31, 2019

Just a note: poetry could print a message like If the package you try to install is in alpha/beta, try with the --allow-prereleases flag when the command fails. Currently, people experiencing this issue must come here on the issue tracker and search for this problem to get the solution, which is not efficient. Sometimes they will even open duplicate issues 😅 A simple message could help reduce this.

$ poetry add sty

[ValueError]                         
Could not find a matching version of package sty
If the package you want to install is in alpha/beta, try with the --allow-prereleases flag  

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

@paranoidi
Copy link

paranoidi commented Jul 10, 2019

The message given by black is confusing and inadequate in this instance. The message should be improved so that user understands situation properly.

Better message might be,

Could not find a matching stable version of package black. Use --allow-prereleases to remove restrictions.

Edit: Opened PR #1216

paranoidi pushed a commit to paranoidi/poetry that referenced this issue Jul 10, 2019
@stale
Copy link

stale bot commented Nov 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 13, 2019
@stale
Copy link

stale bot commented Nov 20, 2019

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.

@stale stale bot closed this as completed Nov 20, 2019
Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants