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

cannot import name create_environment with virtualenv >= 20 #2093

Closed
1 of 3 tasks
cjw296 opened this issue Feb 27, 2020 · 8 comments · Fixed by #2096
Closed
1 of 3 tasks

cannot import name create_environment with virtualenv >= 20 #2093

cjw296 opened this issue Feb 27, 2020 · 8 comments · Fixed by #2096
Assignees
Labels
kind/bug Something isn't working as expected

Comments

@cjw296
Copy link

cjw296 commented Feb 27, 2020

Issue

virtualenv 20 was released earlier this month, and looks like CircleCI's images were just rebuilt to use it. So, now, on Python 2, poetry install fails as follows:

circleci@32ce45b8e19b:~/project$ poetry install -v
Creating virtualenv carly-3aSsmiER-py2.7 in /home/circleci/.cache/pypoetry/virtualenvs

[ImportError]
cannot import name create_environment

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/usr/local/lib/python2.7/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/usr/local/lib/python2.7/site-packages/clikit/api/command/command.py", line 163, in _do_handle
    self._dispatcher.dispatch(PRE_HANDLE, event)
  File "/usr/local/lib/python2.7/site-packages/clikit/api/event/event_dispatcher.py", line 22, in dispatch
    self._do_dispatch(listeners, event_name, event)
  File "/usr/local/lib/python2.7/site-packages/clikit/api/event/event_dispatcher.py", line 89, in _do_dispatch
    listener(event, event_name, self)
  File "/usr/local/lib/python2.7/site-packages/poetry/console/config/application_config.py", line 89, in set_env
    env = env_manager.create_venv(io)
  File "/usr/local/lib/python2.7/site-packages/poetry/utils/env.py", line 610, in create_venv
    self.build_venv(str(venv), executable=executable)
  File "/usr/local/lib/python2.7/site-packages/poetry/utils/env.py", line 674, in build_venv
    from virtualenv import create_environment

The most pragmatic solution, at this point, is to have poetry pin the virtualenv it uses to <20, or just vendor it, since realistically, it's only going to be used on Python 2, right?

@cjw296 cjw296 added the kind/bug Something isn't working as expected label Feb 27, 2020
@finswimmer finswimmer self-assigned this Feb 27, 2020
@finswimmer
Copy link
Member

Hey @cjw296,

could you please test if #2096 fixes this problem?

fin swimmer

@cjw296
Copy link
Author

cjw296 commented Feb 28, 2020

Not easily, how would you recommend I do that?

@sdispater
Copy link
Member

@cjw296 I don't understand how you end up with virtualenv >20 since Poetry restricts the virtualenv version: https://github.com/python-poetry/poetry/blob/master/pyproject.toml#L49. So there must be something wrong with your environment.

@Drarok
Copy link

Drarok commented Feb 28, 2020

@sdispater I'm also a user of CircleCI and seeing the same issue. CircleCI appear to pre-install poetry on their image, but have also upgraded the system virtualenv to 20. 😕

@cjw296
Copy link
Author

cjw296 commented Feb 28, 2020

@cjw296
Copy link
Author

cjw296 commented Feb 28, 2020

I wonder where pip is coming from and what version it is? Maybe @FelicianoTech can help with this?

@cjw296
Copy link
Author

cjw296 commented Feb 28, 2020

Where do we find the docker file for the upstream Python image?

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

Successfully merging a pull request may close this issue.

4 participants