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 export creates a virtualenv #78

Closed
touilleMan opened this issue Jun 22, 2022 · 4 comments · Fixed by #106
Closed

Poetry export creates a virtualenv #78

touilleMan opened this issue Jun 22, 2022 · 4 comments · Fixed by #106

Comments

@touilleMan
Copy link

When running from outside of a virtualenv, poetry export will create a virtualenv before running the command.
This has two issues:

On top of that creating the virtualenv is not needed for this command (I've tried with poetry config --local virtualenvs.create true and it works as expected)

@dimbleby
Copy link
Contributor

The ExportCommand used to be a mere Command but now it is an InstallerCommand, which in turn is an EnvCommand.

I believe that it was made an InstallerCommand so that it had access to group dependency options, but it didn't really want to be an EnvCommand.

@HansBambel
Copy link

Using Poetry v1.2.0 this produces an error also when virtualenvs.create is disabled:

Building in Docker I received an error when running the following command:
RUN poetry export -f requirements.txt | pip install -r /dev/stdin

Error:

RUN poetry export -f requirements.txt | pip install -r /dev/stdin:
#0 26.79 ERROR: Invalid requirement: 'Skipping virtualenv creation, as specified in config file.' (from line 1 of /dev/stdin)

I am assuming that #106 fixes this as well

@dimbleby
Copy link
Contributor

dimbleby commented Sep 1, 2022

meanwhile send the output to file --output requirements.txt and use that, or (I haven't tested) --quiet might do the trick

@HansBambel
Copy link

As a workaround I did the following:

RUN poetry export -f requirements.txt --output requirements.txt
RUN pip install -r requirements.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants