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 keep recreating virtualenv, in the case of .venv seems to be broken. #3353

Closed
3 tasks done
wasdee opened this issue Nov 11, 2020 · 4 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@wasdee
Copy link
Contributor

wasdee commented Nov 11, 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).

  • OS version and name: Windows 10 Build 19042.610/Powershell Core 7

  • Poetry version: Poetry version 1.1.4

  • Link of a Gist with the contents of your pyproject.toml file: believed not relevant

Issue

To reproduce,

  1. poetry install
  2. move the project pkg to other directory(project dir has .venv)
  3. poetry install
  4. poetry install

Verbose in step 3,4

The virtual environment found in C:\Users\foo\projectA\.venv seems to be broken.
Recreating virtualenv app in C:\Users\foo\bar\projectA\.venv

Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 144 installs, 0 updates, 0 removals

Expect

The Recreating only happen once in step 3

Workaround

delete .venv and poetry install

@wasdee wasdee added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 11, 2020
@jonatasoli
Copy link

Hello,

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

Steps to reproduce:

  • Configure global pyenv in version 3.9.2 and 3.7.10
  • Configure the pyenv path in the fish
  • Install poetry via curl
  • change the virtualenv path
  • give a poetry install
  • then give a poetry shell

Issue

I recently installed poetry using the command below on a laptop with manjaro

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
> poetry shell -vvv                                     08:38:30
The currently activated Python version 3.9.2 is not supported by the project (~3.7).
Trying to find and use a compatible version. 
Trying python3
Trying python3.7
Using python3.7 (3.7.10)
The virtual environment found in /home/jonatas/workspace/partyou-web/.venv seems to be broken.
Recreating virtualenv partyou-web-tDRUIHHD-py3.7 in .venv/partyou-web-tDRUIHHD-py3.7
Using virtualenv: .venv/partyou-web-tDRUIHHD-py3.7
Spawning shell within .venv/partyou-web-tDRUIHHD-py3.7
source .venv/partyou-web-tDRUIHHD-py3.7/bin/activate.fish
> source .venv/partyou-web-tDRUIHHD-py3.7/bin/activate.fish

I'm using pyenv with fish shell to run, I also changed the path of virtualenv to be .venv, when I give a poetry install he installs all dependencies, however when I give a poetry shell he says that my .venv is broken there I need to install the dependencies again.

For me, the same problem happens as @CircleOnCircles every time I leave virtualenv I need to reinstall all dependencies.

@jonatasoli
Copy link

jonatasoli commented Mar 22, 2021

I solve with this procced:

poetry config virtualenvs.path --unset
poetry config virtualenvs.in-project true

@finswimmer
Copy link
Member

Hello @CircleOnCircles,

you cannot move venv folders. If you do so, symlinks used in this folder get's broken. This has nothing to do. It's a limitation of how venv folder work.

fin swimmer

@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 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 2, 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

4 participants