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

[Bug Report] Invalid Poetry Virtualenvs with python as a symbolic link #7085

Closed
4 tasks done
Dragon1573 opened this issue Nov 23, 2022 · 4 comments
Closed
4 tasks done
Labels
status/duplicate Duplicate issues

Comments

@Dragon1573
Copy link

Environments

  • Poetry version: v1.2.2
  • Python version: v3.10.6
  • OS version and name: Ubuntu LTS 22.10 Kinetic in WSL2 on Microsoft Windows 11 Professional 22H2 (22621.819)
  • pyproject.toml: GitHub Gists
Console output of the above informations
➜  School poetry --version
Poetry (version 1.2.2)
➜  School poetry debug info

Poetry
Version: 1.2.2
Python:  3.10.6

Virtualenv
Python:         3.10.7
Implementation: CPython
Path:           /home/dragon1573/Code/School/.venv
Executable:     python
Valid:          False

System
Platform:   linux
OS:         posix
Python:     3.10.7
Path:       /usr
Executable: /usr/bin/python3.10
➜  School wslfetch

               .-/+oossssoo+/-.               Windows Subsystem for Linux (WSL2)
           `:+ssssssssssssssssss+:`           dragon1573@MateBook-X-Pro
         -+ssssssssssssssssssyyssss+-         Build: 22621
       .ossssssssssssssssssdMMMNysssso.       Branch: ni_release
      /ssssssssssshdmmNNmmyNMMMMhssssss/      Release: Ubuntu 22.10
     +ssssssssshmydMMMMMMMNddddyssssssss+     Kernel: Linux 5.15.74.2-microsoft-standard-WSL2
    /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Uptime: 1d 21h 58m
   .ssssssssdMMMNhsssssssssshNMMMdssssssss.
   +sssshhhyNMMNyssssssssssssyNMMMysssssss+
   ossyNMMMNyMMhsssssssssssssshmmmhssssssso
   ossyNMMMNyMMhsssssssssssssshmmmhssssssso
   +sssshhhyNMMNyssssssssssssyNMMMysssssss+
   .ssssssssdMMMNhsssssssssshNMMMdssssssss.
    /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
     +sssssssssdmydMMMMMMMMddddyssssssss+
      /ssssssssssshdmNNNNmyNMMMMhssssss/
       .ossssssssssssssssssdMMMNysssso.
         -+sssssssssssssssssyyyssss+-
           `:+ssssssssssssssssss+:`
               .-/+oossssoo+/-.

➜  School lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.10
Release:        22.10
Codename:       kinetic
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.
Output logs from debug mode
➜  School poetry env use 3.10.7 -vvv
Loading configuration file /home/dragon1573/.config/pypoetry/config.toml
Adding repository bfsu (https://mirrors.bfsu.edu.cn/pypi/web/simple) and setting it as the default one
Deactivating the PyPI repository
Creating virtualenv school in /home/dragon1573/Code/School/.venv
Using virtualenv: /home/dragon1573/Code/School/.venv

Issue

Poetry create an invalid virtual environment inside project. .venv/local/bin/python is a symbolic link to system intepreter, not an executable "isolated" from the system one.

image

Copied outputs from console
➜  School poetry debug info

Poetry
Version: 1.2.2
Python:  3.10.6

Virtualenv
Python:         3.10.7
Implementation: CPython
Path:           /home/dragon1573/Code/School/.venv
Executable:     python
Valid:          False

System
Platform:   linux
OS:         posix
Python:     3.10.7
Path:       /usr
Executable: /usr/bin/python3.10
➜  School file .venv/local/bin/*
.venv/local/bin/activate:         ASCII text
.venv/local/bin/activate.csh:     ASCII text, with very long lines (316)
.venv/local/bin/activate.fish:    ASCII text
.venv/local/bin/activate.nu:      ASCII text
.venv/local/bin/activate.ps1:     ASCII text
.venv/local/bin/activate_this.py: Python script, ASCII text executable
.venv/local/bin/deactivate.nu:    ASCII text
.venv/local/bin/pip:              a /home/dragon1573/Code/School/.venv/local/bin/python script, ASCII text executable
.venv/local/bin/pip-3.10:         a /home/dragon1573/Code/School/.venv/local/bin/python script, ASCII text executable
.venv/local/bin/pip3:             a /home/dragon1573/Code/School/.venv/local/bin/python script, ASCII text executable
.venv/local/bin/pip3.10:          a /home/dragon1573/Code/School/.venv/local/bin/python script, ASCII text executable
.venv/local/bin/python:           symbolic link to /usr/bin/python3.10
.venv/local/bin/python3:          symbolic link to python
.venv/local/bin/python3.10:       symbolic link to python
.venv/local/bin/wheel:            a /home/dragon1573/Code/School/.venv/local/bin/python script, ASCII text executable
.venv/local/bin/wheel-3.10:       a /home/dragon1573/Code/School/.venv/local/bin/python script, ASCII text executable
.venv/local/bin/wheel3:           a /home/dragon1573/Code/School/.venv/local/bin/python script, ASCII text executable
.venv/local/bin/wheel3.10:        a /home/dragon1573/Code/School/.venv/local/bin/python script, ASCII text executable
➜  School
@Dragon1573 Dragon1573 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 23, 2022
@dimbleby
Copy link
Contributor

dimbleby commented Nov 23, 2022

the issue is not the symlink, that's completely normal.

you seem somehow to have created some confusion about where the virtual environment is

  • poetry env info shows it in /home/dragon1573/Code/School/.venv (and not a subdirectory of that)
  • you are showing a virtual environment in .venv/local

I don't know how you've got into this state, but that's the mess you'll need to untangle

@Dragon1573
Copy link
Author

Dragon1573 commented Nov 23, 2022

Oops?! Sorry for that ...

I realized that there's no .venv/bin/ folder when new Poetry projects created. I research the issues and find a walkaround in this comment.

It said that there's something different on Debian/Ubuntu, which pip list will display a python-debian instead of official python.

Thanks for your tips! This issue can be closed (or maybe deletable?)

@Dragon1573 Dragon1573 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2022
@neersighted
Copy link
Member

Duplicate #6371, the environment is invalid, it is a Ubuntu/Debian bug.

@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 23, 2022
Copy link

github-actions bot commented Mar 1, 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 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

3 participants