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 env list, can not output env path #2161

Closed
3 tasks
leileigong opened this issue Mar 10, 2020 · 10 comments · Fixed by #4813
Closed
3 tasks

poetry env list, can not output env path #2161

leileigong opened this issue Mar 10, 2020 · 10 comments · Fixed by #4813
Labels
area/cli Related to the command line kind/bug Something isn't working as expected

Comments

@leileigong
Copy link

leileigong commented Mar 10, 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:
  • Poetry version:
  • Link of a Gist with the contents of your pyproject.toml file:

poetry env list, can not output env path

comand poetry env list --full-path output nothing on windows dos shell.

E:\FNTools>poetry env list --full-path

E:\FNTools>

but it works ok on bash shell, for example git bash shell.

lei@DESKTOP-AM65SOJ /E/FNTools (master)
$ poetry env list --full-path
C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fntools-gSpOuuiR-py3.6 (Activated)
@leileigong leileigong added the kind/bug Something isn't working as expected label Mar 10, 2020
@finswimmer
Copy link
Member

Hello @leileigong,

which version of poetry are you using and which windows OS do you use?

I've tried with poetry 1.0.5 under windows 10 within cmd and powershell and both show me the full path of the venv.

fin swimmer

@finswimmer finswimmer added the area/cli Related to the command line label Mar 10, 2020
@leileigong
Copy link
Author

Hello @finswimmer,
I also use poetry 1.0.5 , on windows 10.
I tried "cmd.exe" and powershell programs , these two shells got the same problem.

cmd.exe:

E:\FNTools>poetry config --list
cache-dir = "C:\\Users\\lei\\AppData\\Local\\pypoetry\\Cache"
virtualenvs.create = true
virtualenvs.in-project = false
virtualenvs.path = "{cache-dir}\\virtualenvs"  # C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs

E:\FNTools>

powershell:

PS E:\FNTools> poetry config --list
cache-dir = "C:\\Users\\lei\\AppData\\Local\\pypoetry\\Cache"
virtualenvs.create = true
virtualenvs.in-project = false
virtualenvs.path = "{cache-dir}\\virtualenvs"  # C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs
PS E:\FNTools>

@finswimmer
Copy link
Member

Hm, strange.

How is python installed on your system? How have you installed poetry?

@leileigong
Copy link
Author

python is installed via binary executable file.

i install poetry as follow comand in powershell:

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python

@leileigong
Copy link
Author

@finswimmer I find the problem, i do not sure it's a bug or not.

I create an virtual environment for my project via git bash shell.
My project directory is /E/FNTools which is displayed on bash shell,
and E:\FNTools which is displayed on windows command shell.

so on bash shell, i get an interpreter fntools-gSpOuuiR-py3.6:

lei@DESKTOP-AM65SOJ /E/FNTools (master)
$ poetry env list
fntools-gSpOuuiR-py3.6 (Activated)

lei@DESKTOP-AM65SOJ /E/FNTools (master)
$ poetry env list --full-path
C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fntools-gSpOuuiR-py3.6 (Activated)

but, when i can not see the env on windows command shell.
I get nothing.

E:\FNTools>poetry env list

E:\FNTools>

then I try command poetry install. poetry create another interpreter fntools--CZiHDaJ-py3.6 for the again.

E:\FNTools>poetry env list

E:\FNTools>poetry install
Creating virtualenv fntools--CZiHDaJ-py3.6 in C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs
Installing dependencies from lock file


Package operations: 37 installs, 0 updates, 0 removals
.......

E:\FNTools>poetry env list
fntools--CZiHDaJ-py3.6 (Activated)

E:\FNTools>poetry env list --full-path
C:\Users\lei\AppData\Local\pypoetry\Cache\virtualenvs\fntools--CZiHDaJ-py3.6 (Activated)

But pipenv do not apper this problem on different command shell.

  • windows cmd.exe shell
E:\FNTools>pipenv --venv
C:\Users\lei\.virtualenvs\FNTools-lKp0_7xw
E:\FNTools>
  • unix bash shell:
lei@DESKTOP-AM65SOJ /E/FNTools (master)
$ pipenv --venv
c:\Users\lei\.virtualenvs\FNTools-lKp0_7xw

Maybe pipenv does better at this pointer.

thanks.

@klalumiere
Copy link

I also encountered this issue. <Exec Command="poetry install"/> in MsBuild was working as expected since Exec uses a cmd.exe subshell. However, using execute_process(COMMAND poetry install) with CMake created a virtual environment which was not visible from the Command Line Interface. As a workaround, since cmd.exe is hard to use directly with execute_process and a custom command, I had to file(WRITE "${PROJECT_BINARY_DIR}/poetry.cmd" "${Poetry_EXECUTABLE} %*") and use poetry.cmd instead than poetry. 😞

@vickz84259
Copy link

vickz84259 commented Nov 22, 2020

I have the same issue but in my case, it is opposite to what OP has. There's no output for poetry env list on Git Bash but it works fine in CMD.

I don't know if it might be related but yesterday I had encountered issue #2681 while trying to update poetry. I ended up having to reinstall poetry via the recommended curl command on Git Bash. The poetry env list command was working just fine. Now, today after turning on the computer, I suddenly have this issue. I'm trying to investigate what might be the issue cause I didn't change any configurations yesterday. UPDATE: This was not related

@vickz84259
Copy link

I have figured it out. In my case it was because I was accessing the folder with a different case. Git Bash is case insensitive such that a folder named: PROJECTS, can be accessed with either cd projects or cd PROJECTS. The problem arises when you access one of the folders in the path with a different case from its actual one.

Here's a photo to illustrate this:
{489BB381-A5BF-4611-BFBA-E43DC53CDE0D} png

@radoering
Copy link
Member

Probably related to #2419. Thus, may be fixed by #2421 (which has not yet been merged).

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
area/cli Related to the command line kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants