-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 use fails with NameError: name 'WindowsPath' is not defined #2698
Comments
@moochannel can you try the |
@abn Thank you for your quick reply. Since |
Perfect. This will be released with the next |
Understood. I'll wait for the 1.1.0 release. |
Hello! I decided to start using poetry, but faced such a problem. Tell me what's wrong? Thank you in advance!
|
@intelligent174 upgrade to the pre-release version:
|
@jonapich Hello! I attempted your solution but am still getting the same results as @intelligent174 . I checked the directory it is attempting to find and it is accurate. There is no pypoetry file in that location. Does this mean the original download was flawed and should be uninstalled and re-downloaded? I appreciate any help you have to offer. |
"poetry --version" should give you something like 1.1.0b1 or something. Not 1.0.10 that's where the bug occurs. |
Unfortunately mine is not doing that. After running the pip install you provided to upgrade to the pre-release version, I still have 1.0.10. I must have done something wrong but I'm not sure what. |
Followup: the newest version requires the syntax "poetry self update --preview" in order to work, but even at that it denies permission even if PowerShell runs with administrator access. Every time it gets really close to upgrading but it always runs into a file where access is denied. I'll keep exploring but so far it looks like uninstalling the current version of poetry and then downloading the desired version might be the best workaround. If anyone knows of a better solution please let me know. Thanks! |
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. |
-vvv
option).Issue
When I run
poetry env use "C:\Program Files\Python37\python.exe"
in a directory without a virtual environment, it fails withNameError: name 'WindowsPath' is not defined
.CREATE_VENV_COMMAND.format(path))
in EnvManager.build_venv convertspath
toWindowsPath(path)
, but CREATE_VENV_COMMAND doesn't contain pathlib.WindowsPath. So it results in an error.My workaround here. I suppose the
path
should be converted from WindowsPath to str before it passed toCREATE_VENV_COMMAND.format(path))
.After patching this, the command runs fine.
The text was updated successfully, but these errors were encountered: