M.wol
M.wol

Reputation: 1311

set custom path for virtualenvs using poetry

I am trying out poetry for my projects and wanted to store all virtual envs in one place for the sake of easier searching. I cant seem to get this command working though:

PS C:\Users\********\pyprojects\******> poetry config virtualenvs.path: "C:\Users\********\pyprojects\.venv"

  ValueError

  Setting virtualenvs.path: does not exist

  at ~\.poetry\lib\poetry\console\commands\config.py:248 in handle
      244│                 raise ValueError("You must pass exactly 1 value")
      245│
      246│             return 0
      247│
    → 248│         raise ValueError("Setting {} does not exist".format(self.argument("key")))
      249│
      250│     def _handle_single_value(self, source, key, callbacks, values):
      251│         validator, normalizer, _ = callbacks
      252│

From https://python-poetry.org/docs/configuration/:

virtualenvs.path: string Directory where virtual environments will be created. Defaults to {cache-dir}/virtualenvs ({cache-dir}\virtualenvs on Windows).

I tried with single quotes, without quotes. Not working either. What am I missing?

Upvotes: 1

Views: 7705

Answers (2)

M.wol
M.wol

Reputation: 1311

Ok, silly me...

C:\Users\********\pyprojects\******> poetry config virtualenvs.path C:\Users\********\pyprojects\.venv

It works without quotes and without colon

Upvotes: -1

jidicula
jidicula

Reputation: 3929

Try it without the colon:

PS C:\Users\********\pyprojects\******> poetry config virtualenvs.path: "C:\Users\********\pyprojects\.venv"
                                                                      ^
                                                      unnecessary colon

so your command would actually be

poetry config virtualenvs.path "C:\Users\********\pyprojects\.venv"

Upvotes: 2

Related Questions