Open NujanZh opened 3 years ago
The same error in Windows 11 for Python 3.9 installed via Windows Store.
same error win10 for Python 3.9 and 3.10 installed via WS
same error
same error
same error:
Win 11 python 3.9 from windows store poetry 1.1.12 installed via powershell
I was trying to run the init through pycharm which gives some traceback:
[WinError 1920] The file cannot be accessed by the system: 'C:\Users\steve\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe\Scripts'
at C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\pathlib.py:1232 in stat
Traceback (most recent call last):
File "C:\Users\steve.poetry\lib\poetry_vendor\py3.9\clikit\console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "C:\Users\steve.poetry\lib\poetry_vendor\py3.9\clikit\api\command\command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "C:\Users\steve.poetry\lib\poetry_vendor\py3.9\clikit\api\command\command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "C:\Users\steve.poetry\lib\poetry_vendor\py3.9\cleo\commands\command.py", line 92, in wrap_handle
return self.handle()
File "C:\Users\steve.poetry\lib\poetry\console\commands\init.py", line 144, in handle
current_env = SystemEnv(Path(sys.executable))
File "C:\Users\steve.poetry\lib\poetry\utils\env.py", line 936, in init
self.find_executables()
File "C:\Users\steve.poetry\lib\poetry\utils\env.py", line 1080, in find_executables
[
File "C:\Users\steve.poetry\lib\poetry\utils\env.py", line 1080, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\steve.poetry\bin\poetry", line 19, in
So...i'm not a windows person at all..so i'll just forget that.
Does the file exist? Can you..open it as a regular user? Can you maybe try as an admin user?
@clintonroy the path that was being opened looks like it's been concatenated from an environment property that included the name of the python executable and "\Scripts" - the path doesn't exist.
C:\Users\steve\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe\Scripts
I suspect the first part of the path is not what was expected in the poetry code and is a side effect of the way the MSStore installs python.
Note that removing the MSStore version of python and replacing with the python for windows version from python.org resulted in poetry working for me just now.
Forgot to say I had to change the launch batch file %USERPROFILE%.poetry\bin\poetry.bat as it was trying to run python3 which I guess is again a side effect of installing from the MS Store. I changed it to run python
python "%USERPROFILE%\.poetry\bin\poetry" %*
Hope that helps anyone who ended up here. Windows pushes you towards the MS store version via winget but you can install the python.org version via winget as well. It just downloads the installer so there isn't really a difference between using winget and running the installer manually as far as I know.
The thing is that I uninstalled MS python, but know that I have the python org version, poetry installation is not being recognized and I have no way to uninstall poetry... any idea.
Has the poetry team looked at the issue? Basically the recommended python install on windows 10/11 via the store is not compatible with Poetry. easiest solution is to install python via the official website. Note: uninstall script is also ko.
"poetry new poetry-demo" --> OSError
[WinError 1920] The file cannot be accessed by the system: 'C:\Users\xxxxxx\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe\Scripts'
at C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\pathlib.py:1095 in stat 1091│ 1092│ Return the result of the stat() system call on this path, like 1093│ os.stat() does. 1094│ """ → 1095│ return self._accessor.stat(self, follow_symlinks=follow_symlinks) 1096│ 1097│ def owner(self): 1098│ 1099│ Return the login name of the file owner.
At the end I had to uninstall poetry manually I searched all related files and erased them and installed again. I don't know if that could have a negative effect or lead to future mistakes, but so far, I haven't had any issue with my latest Poetry installation. I installed poetry with the cmd line from the official Poetry documentation.
I have uninstalled ms store verison of python and changed %USERPROFILE%.poetry\bin\poetry.bat
as mentioned in https://github.com/python-poetry/poetry/issues/4667#issuecomment-997732616.
I resolved by installing poetry with pipx. I hope that helps. :) I have the Windows Store python 3.10.4 version
I got a similar error ('charmap' codec can't encode character '\U0001f40d' in position 68: character maps to <undefined>
) when using poetry show
on github, it broke right before the line of the mergedeep
package, because of the snake in description = "A deep merge function for 🐍."
. It might be related so I though tot share
-vvv
option).Issue
I type
poetry init
and it give me this error: ` [WinError 1920] Доступ к этому файлу из системы отсутствует (Translate: this file cannot be accessed from the system.): 'C:\Users\*****\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe\Scripts'at C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\pathlib.py:1198 in stat 1194│ 1195│ Return the result of the stat() system call on this path, like 1196│ os.stat() does. 1197│ """ → 1198│ return self._accessor.stat(self) 1199│ 1200│ def owner(self): 1201│ 1202│ Return the login name of the file owner.
`