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

Invalid dev dependency #428

Closed
3 tasks done
ghost opened this issue Sep 12, 2018 · 8 comments
Closed
3 tasks done

Invalid dev dependency #428

ghost opened this issue Sep 12, 2018 · 8 comments

Comments

@ghost
Copy link

ghost commented Sep 12, 2018

  • 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: Ubuntu 18.04
  • Poetry version: Poetry 0.11.5
  • Link of a Gist with the contents of your pyproject.toml file: None

Issue

Doing the following:

git clone https://github.com/sdispater/poetry && cd poetry
poetry install

Poetry fails to install black 18.6b4 with this error using -vvv:

Installing dependencies from lock file


Package operations: 8 installs, 0 updates, 1 removal, 53 skipped

  - Skipping six (1.11.0) Already installed
  - Skipping atomicwrites (1.2.1) Already installed
  - Skipping attrs (18.2.0) Already installed
  - Skipping certifi (2018.8.24) Already installed
  - Skipping chardet (3.0.4) Already installed
  - Skipping colorama (0.3.9) Not needed for the current platform
  - Skipping idna (2.7) Already installed
  - Skipping markupsafe (1.0) Already installed
  - Skipping more-itertools (4.3.0) Already installed
  - Skipping pluggy (0.7.1) Already installed
  - Skipping py (1.6.0) Already installed
  - Skipping pyyaml (3.13) Already installed
  - Skipping tornado (5.1) Already installed
  - Skipping urllib3 (1.23) Already installed
  - Skipping appdirs (1.4.3) Already installed
  - Skipping aspy.yaml (1.1.1) Already installed
  - Skipping cached-property (1.5.1) Already installed
  - Skipping cfgv (1.1.0) Already installed
  - Skipping click (6.7) Already installed
  - Skipping coverage (4.5.1) Already installed
  - Skipping identify (1.1.5) Already installed
  - Skipping jinja2 (2.10) Already installed
  - Skipping livereload (2.5.2) Already installed
  - Skipping lockfile (0.12.2) Already installed
  - Skipping markdown (2.6.11) Already installed
  - Skipping msgpack (0.5.6) Already installed
  - Skipping nodeenv (1.3.2) Already installed
  - Skipping pastel (0.1.0) Already installed
  - Skipping pygments (2.2.0) Already installed
  - Skipping pylev (1.3.0) Already installed
  - Skipping pytest (3.8.0) Already installed
  - Skipping requests (2.19.1) Already installed
  - Skipping toml (0.9.6) Already installed
  - Skipping virtualenv (16.0.0) Already installed
  - Skipping webencodings (0.5.1) Already installed
  - Installing black (18.6b4)
                                                                                                
[VenvCommandError]                                                               
Command ['pip', 'install', '--no-deps', 'black==18.6b4'] errored with the following output:   
Collecting black==18.6b4                                                                      
  Could not find a version that satisfies the requirement black==18.6b4 (from versions: )     
No matching distribution found for black==18.6b4                                              
                                                                                                
Exception trace:
 /home/dimitris/.local/lib/python3.6/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/dimitris/.local/lib/python3.6/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /home/dimitris/.local/lib/python3.6/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /home/dimitris/.local/lib/python3.6/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/console/commands/install.py in handle() at line 50
   return installer.run()
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/installation/installer.py in run() at line 76
   self._do_install(local_repo)
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/installation/installer.py in _do_install() at line 286
   self._execute(op)
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/installation/installer.py in _execute() at line 294
   getattr(self, "_execute_{}".format(method))(operation)
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/installation/installer.py in _execute_install() at line 319
   self._installer.install(operation.package)
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/installation/pip_installer.py in install() at line 76
   self.run(*args)
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/installation/pip_installer.py in run() at line 91
   return self._venv.run("pip", *args, **kwargs)
 /home/dimitris/.local/lib/python3.6/site-packages/poetry/utils/venv.py in run() at line 274
   raise VenvCommandError(e)

The issue is that pip2 doesn't find the version 18.6b4

/usr/bin/pip2 install -U black==18.6b4                                                               
Collecting black==18.6b4
  Could not find a version that satisfies the requirement black==18.6b4 (from versions: )
No matching distribution found for black==18.6b4

Pip3 does find the version:

 /usr/bin/pip3 install -U black==18.6b4                                                             1 master
Collecting black==18.6b4
  Using cached https://files.pythonhosted.org/packages/4e/b5/575cdaabf1f98ebe50c0ee85b202fcce3b8df1f21d6ed02708bc539674c3/black-18.6b4-py36-none-any.whl
Collecting toml>=0.9.4 (from black==18.6b4)
  Using cached https://files.pythonhosted.org/packages/c7/19/76c3cb84949a0593767b32b9be83a604d8a68c3580ff5d0ee64856b39ade/toml-0.9.6-py2.py3-none-any.whl
Collecting attrs>=17.4.0 (from black==18.6b4)
  Using cached https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Collecting appdirs (from black==18.6b4)
  Using cached https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl
Collecting click>=6.5 (from black==18.6b4)
  Using cached https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl
Installing collected packages: toml, attrs, appdirs, click, black
Successfully installed appdirs-1.4.3 attrs-18.2.0 black-18.6b4 click-6.7 toml-0.9.6
@sdispater
Copy link
Member

What is the output of poetry debug:info?

@ghost ghost changed the title Invalid dev depency Invalid dev dependency Sep 12, 2018
@ghost
Copy link
Author

ghost commented Sep 12, 2018

dimitris@foobar ~/poetry> poetry debug:info                                                              1 master

Poetry
======

 * Version: 0.11.5
 * Python:  3.6.5


Virtualenv
==========

 * Python:         3.6.5
 * Implementation: CPython
 * Path:           /home/dimitris/.cache/pypoetry/virtualenvs/poetry-py3.6


System
======

 * Platform: linux
 * OS:       posix

@sdispater
Copy link
Member

This is strange. Why is Poetry using the pip from a Python 2 executable since the virtualenv is Python 3.6?

@ghost
Copy link
Author

ghost commented Sep 13, 2018

Alright, I have figured it out. Simply calling /usr/bin/pip or pip doesn't guarantee that pip3 will run and is very dependent on the distribution and Os.

To test the hypothesis, I created a symbolic link as such:

sudo ln -s /usr/bin/pip3 /usr/bin/pip

Then run poetry install and it has successfully installed all dependencies.

Perhaps a note somewhere in documentation or say calling pip3 instead of pip can prevent this from happening again.

@robertlagrant
Copy link

I've also hit the same problem installing black:

$ poetry add --dev black
                                                      
[ValueError]                           
Could not find a matching version of package black

(That's from inside a 3.6 pyenv virtualenv.)

@pmav99
Copy link
Contributor

pmav99 commented Feb 25, 2019

Black doesn't have a stable release yet. You need to install it with:

poetry add --dev --allow-prereleases black

@M5oul
Copy link

M5oul commented Jun 4, 2019

Corresponding ticket in Black psf/black#517.

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