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

AttributeError occurred when install dependencies: module 'jsonschema' has no attribute 'Draft7Validator' #2312

Closed
3 tasks done
cmsax opened this issue Apr 15, 2020 · 3 comments
Labels
kind/bug Something isn't working as expected

Comments

@cmsax
Copy link

cmsax commented Apr 15, 2020

  • 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).

Issue

Exception occurred when I try to install dependencies with poetry install:

$ poetry install -v

[AttributeError]
module 'jsonschema' has no attribute 'Draft7Validator'

Traceback (most recent call last):
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/clikit/api/command/command.py", line 163, in _do_handle
    self._dispatcher.dispatch(PRE_HANDLE, event)
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/clikit/api/event/event_dispatcher.py", line 22, in dispatch
    self._do_dispatch(listeners, event_name, event)
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/clikit/api/event/event_dispatcher.py", line 89, in _do_dispatch
    listener(event, event_name, self)
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/poetry/console/config/application_config.py", line 86, in set_env
    poetry = command.poetry
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/poetry/console/commands/command.py", line 10, in poetry
    return self.application.poetry
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/poetry/console/application.py", line 49, in poetry
    self._poetry = Factory().create_poetry(Path.cwd())
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/poetry/factory.py", line 48, in create_poetry
    check_result = self.validate(local_config)
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/poetry/factory.py", line 272, in validate
    validation_errors = validate_object(config, 'poetry-schema')
  File "/Users/username/Library/Python/3.7/lib/python/site-packages/poetry/json/__init__.py", line 27, in validate_object
    validator = jsonschema.Draft7Validator(schema)

jsonschema version:

$ pip list | grep jsonschema
jsonschema                    3.2.0

The latest jsonschema has attribute Draft7Validator according to jsonschema's documentation

@cmsax cmsax added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 15, 2020
@cmsax
Copy link
Author

cmsax commented Apr 15, 2020

I solved this issue by:

  1. remove poetry in virtualenv
  2. remove poetry out of virtualenv by remove poetry binary
  3. reinstall poetry in virtualenv

It may because poetry ran with wrong binary.

@BinamB
Copy link

BinamB commented Jun 9, 2020

I ran into this issue few days ago. Seems to me its some dependency conflict when you try to do pip install poetry. Using the bootstrap script for installing worked for me.
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

@abn abn removed the status/triage This issue needs to be triaged label Sep 25, 2020
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
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants