Closed Unerty closed 4 hours ago
Looks like a Windows-related issue
This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.
This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.
This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon. If you wish to exclude this issue from being marked as stale, add the "backlog" label.
Closing this issue as it hasn't seen activity for a while. Please add a comment @mentioning a maintainer to reopen. If you wish to exclude this issue from being marked as stale, add the "backlog" label.
Sorry but is this issue going to be fixed? Seems like a big disappointment for me as a new user discovering this cool project!
@DeadlySquad13 Thanks for pointing this out. I've reopened the issue. Contributions are welcome!
Hi , has there been any fix on this issue? It's seems like a deal breaker on windows. Looks like WSL is the only way to go about it?
Stumbled upon similar error when trying to run npx projen new awscdk-app-py --poetry
on windows, thought it was poetry-related but it looks it's a wider issue.
I guess this is still not fixed. :( I get the same error when creating python project
I guess this is still not fixed. :( I get the same error when creating python project
@lzmkhan can you run pip
independently of projen? I'm wondering if this might be an environment setup issue (which would currently be out of scope for projen).
I get this error when running the command ""npx projen new awscdk-app-py""
👾 Project definition file was created at E:\test.projenrc.py
👾 Setting up a virtual environment...
👾 Environment successfully created (located in ./.env).
👾 Installing dependencies...
👾 install | pip install --upgrade pip
'pip' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\NITRO 5\AppData\Local\npm-cache_npx\80cfb0dc84733c29\node_modules\projen\lib\task-runtime.js:147
throw new Error(Task "${this.fullname}" failed when executing "${command}" (cwd: ${(0, path_1.resolve)(cwd ?? this.workdir)})
);
^
Error: Task "install" failed when executing "pip install --upgrade pip" (cwd: E:\test)
at new RunTask (C:\Users\NITRO 5\AppData\Local\npm-cache_npx\80cfb0dc84733c29\node_modules\projen\lib\task-runtime.js:147:27)
at TaskRuntime.runTask (C:\Users\NITRO 5\AppData\Local\npm-cache_npx\80cfb0dc84733c29\node_modules\projen\lib\task-runtime.js:52:9)
at Pip.installDependencies (C:\Users\NITRO 5\AppData\Local\npm-cache_npx\80cfb0dc84733c29\node_modules\projen\lib\python\pip.js:51:17)
at AwsCdkPythonApp.postSynthesize (C:\Users\NITRO 5\AppData\Local\npm-cache_npx\80cfb0dc84733c29\node_modules\projen\lib\python\python-project.js:172:26)
at AwsCdkPythonApp.synth (C:\Users\NITRO 5\AppData\Local\npm-cache_npx\80cfb0dc84733c29\node_modules\projen\lib\project.js:357:18)
at evalmachine.
BUt globally pip is fully installed in the latest version
Thanks @amit-cubit for reporting. What happens if you try running this command:
cmd.exe /c "pip --version"
This checks if cmd.exe
can find pip
. Which is what projen does under the hood. If the command doesn't print the pip
version, something isn't working in your environment.
the pip --version command works E:>cmd.exe /c "pip --version" pip 24.2 from C:\Users\NITRO 5\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)
Thanks for running the command @amit-cubit I'm still trying to reproduce this. Not entirely sure what the issue is yet. 😕
The above issue appears to be about the python in the virtual env created by projen. There the pip version is 22 and upgrade command fails when executed with the .env activated.
Is there a workaround for this?
Hmm. You could try using the --pipenv
or --poetry
flag. Maybe they can deal better with Windows.
'pip' is not recognized as an internal or external command,
The error might be due to the generated PATH
in .projen/tasks.json
like this:
"PATH": "$(echo $PWD/.env/bin:$PATH)"
The value is not valid for Windows:
cmd
is not $PWD
but %cd%
venv
on Windows does not make bin
directory but Scripts
(see venv doc)PATH
environment variable separator for Windows is not :
but ;
A workaround is to add the following line to .projenrc.py
:
project.tasks.add_environment('PATH', '$(echo %cd%\\.env\\Scripts;%PATH%)')
It will overwrite the PATH
like this:
"PATH": "$(echo %cd%\\.env\\Scripts;%PATH%)"
Keeping this issue alive, Same issue on windows:
👾 Project definition file was created at C:\dev\test\projen-test.projenrc.py
👾 Setting up a virtual environment...
👾 Environment successfully created (located in ./.env).
👾 Installing dependencies...
👾 install | pip install --upgrade pip
'pip' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\harmjeff\AppData\Roaming\nvm\v18.20.4\node_modules\projen\lib\task-runtime.js:147
throw new Error(Task "${this.fullname}" failed when executing "${command}" (cwd: ${(0, path_1.resolve)(cwd ?? this.workdir)})
);
^
Error: Task "install" failed when executing "pip install --upgrade pip" (cwd: C:\dev\test\projen-test)
at new RunTask (C:\Users\harmjeff\AppData\Roaming\nvm\v18.20.4\node_modules\projen\lib\task-runtime.js:147:27)
at TaskRuntime.runTask (C:\Users\harmjeff\AppData\Roaming\nvm\v18.20.4\node_modules\projen\lib\task-runtime.js:52:9) at Pip.installDependencies (C:\Users\harmjeff\AppData\Roaming\nvm\v18.20.4\node_modules\projen\lib\python\pip.js:51:17)
at PythonProject.postSynthesize (C:\Users\harmjeff\AppData\Roaming\nvm\v18.20.4\node_modules\projen\lib\python\python-project.js:172:26)
at PythonProject.synth (C:\Users\harmjeff\AppData\Roaming\nvm\v18.20.4\node_modules\projen\lib\project.js:357:18)
at evalmachine.
Great lead @matt9ucci
Can't create a python project.
pip
executable is not found by projen, despite it's installed and available.Given:
When executing the following:
Then, the process ends with an error:
Full log: