Poetry: Can't install packages that have dots in their names

Created on 16 May 2018  路  11Comments  路  Source: python-poetry/poetry

The package is found but can not be installed. The dot is replaced with a dash and then the package with the dashed name can't be found. For example:


$聽poetry add wheezy.web
Using version ^0.1.485 for wheezy.web

Updating dependencies
Resolving dependencies.........


Package operations: 1 install, 0 updates, 0 removals

Writing lock file

  - Installing wheezy-web (0.1.485)

[VenvCommandError]                                               
Command ['pip', 'install', '--no-deps', '-r', '/tmp/wheezy-web-0.1.485l7n3up  
cmreqs.txt'] errored with the following output:                               
Collecting wheezy-web==0.1.485 (from -r /tmp/wheezy-web-0.1.485l7n3upcmreqs.  
txt (line 1))                                                                 
  Could not find a version that satisfies the requirement wheezy-web==0.1.48  
5 (from -r /tmp/wheezy-web-0.1.485l7n3upcmreqs.txt (line 1)) (from versions:  
 )                                                                            
No matching distribution found for wheezy-web==0.1.485 (from -r /tmp/wheezy-  
web-0.1.485l7n3upcmreqs.txt (line 1))                                         

The same thing happens with zope.interface so I'm guessing this goes for all packages that have dots in their names.

Bug

All 11 comments

poetry appears to be changing dots to dashes. I specifically renamed one of my packages on PyPI (coverage.space => coverage-space) because I noticed that dotted names we're going to cause a bit of trouble in TOML.

I will look into this.

It should not change dots to dashes since dots are accepted inside package names.

This also affects a dependency's dependencies:

$ poetry --version
Poetry 0.10.0-alpha.0

$ poetry add drf-yasg==1.4.0
...
- Installing ruamel-yaml (0.15.37)

[VenvCommandError]
Command ['pip', 'install', '--no-deps', '-r', '/var/folders/h1/2b6gts3x37zcnj5khyv8y5180000gn/T/ruamel-yaml-0.15.37powk8ptereqs.txt'] errored with the following output:
Collecting ruamel-yaml==0.15.37 (from -r /var/folders/h1/2b6gts3x37zcnj5khyv8y5180000gn/T/ruamel-yaml-0.15.37powk8ptereqs.txt (line 1))
  Could not find a version that satisfies the requirement ruamel-yaml==0.15.37 (from -r /var/folders/h1/2b6gts3x37zcnj5khyv8y5180000gn/T/ruamel-yaml-0.15.37powk8ptereqs.txt (lin
e 1)) (from versions: )
No matching distribution found for ruamel-yaml==0.15.37 (from -r /var/folders/h1/2b6gts3x37zcnj5khyv8y5180000gn/T/ruamel-yaml-0.15.37powk8ptereqs.txt (line 1))
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

where the correct name is ruamel.yaml.

I am currently running into this issue as well:

Riley:pyramidtesting xistence$ poetry install
Installing dependencies from lock file


Package operations: 2 installs, 0 updates, 0 removals

  - Installing zope.interface (4.5.0)

[VenvCommandError]                                                                                                                                                                                                
Command ['pip', 'install', '--no-deps', '-r', '/var/folders/jy/3csvdt_s3ys8sdn_123w89t00000gp/T/zope-interface-4.5.0xz2icqzdreqs.txt'] errored with the following output:                                                      
Collecting zope-interface==4.5.0 (from -r /var/folders/jy/3csvdt_s3ys8sdn_123w89t00000gp/T/zope-interface-4.5.0xz2icqzdreqs.txt (line 1))                                                                                      
  Could not find a version that satisfies the requirement zope-interface==4.5.0 (from -r /var/folders/jy/3csvdt_s3ys8sdn_123w89t00000gp/T/zope-interface-4.5.0xz2icqzdreqs.txt (line 1)) (from versions: 4.4.0, 4.4.1, 4.4.2)  
No matching distribution found for zope-interface==4.5.0 (from -r /var/folders/jy/3csvdt_s3ys8sdn_123w89t00000gp/T/zope-interface-4.5.0xz2icqzdreqs.txt (line 1))                                                              

install [--no-dev] [--dry-run] [-E|--extras EXTRAS]

I was able to work around this by installing it manually using:

poetry run pip install zope.interface==4.5.0

zope.interface is not a direct dependency of my project.

@sdispater I installed 0.9.1 but it doesn't seem to have this fix. Please confirm. 鉁岋笍

@jacebrowning I just tested on 0.9.1 and it works fine on my end.

@sdispater I tried with toml file but it gives me a version error:

[tool.poetry.dependencies]
python = "^3.5"
delegator.py = { git = "https://github.com/kennethreitz/delegator.py.git", branch = "master"}

@zh0uquan You have to put quotes around delegator.py:

[tool.poetry.dependencies]
python = "^3.5"
"delegator.py" = { git = "https://github.com/kennethreitz/delegator.py.git", branch = "master"}

I'm facing a similar issue trying to insalll dask (http://docs.dask.org/en/latest/install.html), the problem being that if you use poetry add dask it installs the core library but they have sub dependency sets that they recommend installing using, for example, pip install "dask[complete]". I've tried specifying the dask repo when using poetry add but it only picks up the core library. I can get around it by using poetry run pip install "dask[complete]" but am then unsure how to specify the dependencies in the .toml file. Any way around this currently?

@tblazina

poetry add dask -E complete

Will add dask with extras of "complete", and this will appear in your pyproject.toml file:

dask = {version = "^1.1",extras = ["complete"]}

@bertjwregeer, exactly what I was looking for. I didn't realize from the documentation that this is how one uses the extra flag. Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thmo picture thmo  路  3Comments

Euphorbium picture Euphorbium  路  3Comments

ulope picture ulope  路  3Comments

etijskens picture etijskens  路  3Comments

sobolevn picture sobolevn  路  3Comments