firebase-tools: Trying to install functions python runtime on Windows resuslts in OSError

[REQUIRED] Environment info

firebase-tools: 12.3.0

Platform: Windows 11

[REQUIRED] Test case

Run firebase init on Windows.

[REQUIRED] Steps to reproduce

  1. Run firebase init
  2. Select Functions
  3. Select Python
  4. Select Yes on install dependencies

[REQUIRED] Expected behavior

It should install.

[REQUIRED] Actual behavior

[2023-06-02T04:49:57.687Z] Running command with virtualenv: command="C:\src\maiker\functions\venv\Scripts\activate.bat", args=["","&&","pip3","install","--upgrade","pip"]
Requirement already satisfied: pip in c:\src\maiker\functions\venv\lib\site-packages (22.0.4)
Collecting pip
  Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 22.0.4
    Uninstalling pip-22.0.4:
      Successfully uninstalled pip-22.0.4
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Users\\muddi\\AppData\\Local\\Temp\\pip-uninstall-0as7cbwm\\pip3.exe'
Check the permissions.

[2023-06-02T04:50:10.281Z] Error: spawn "C:\src\maiker\functions\venv\Scripts\activate.bat" ENOENT
    at notFoundError (C:\Users\muddi\AppData\Roaming\nvm\v16.17.1\node_modules\firebase-tools\node_modules\cross-spawn\lib\enoent.js:6:26)
    at verifyENOENT (C:\Users\muddi\AppData\Roaming\nvm\v16.17.1\node_modules\firebase-tools\node_modules\cross-spawn\lib\enoent.js:40:16)
    at ChildProcess.cp.emit (C:\Users\muddi\AppData\Roaming\nvm\v16.17.1\node_modules\firebase-tools\node_modules\cross-spawn\lib\enoent.js:27:25)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

Error: An unexpected error has occurred.

Powershell is running as admin

image

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 5
  • Comments: 17 (1 by maintainers)

Most upvoted comments

Having the same issue, would appreciate a workaround!

  1. Open Powershell as admin
  2. Run command: Set-ExecutionPolicy RemoteSigned
  3. Go back to terminal in project
  4. Run command: firebase init
  5. navigate though: select ‘functions’ -> language = python -> (go through until Do you want to install dependencies now?)
  6. Do you want to install dependencies now? Yes

activiate.bat should now be in /functions/venv/Scripts

I was facing some problems, I created a video. Maybe it can help some of you https://www.youtube.com/watch?v=q_sayYt50oM

Hello. Sorry for all the issues. It looks like the Firebase CLI isn’t a reporting a clear error message when some of the necessary tools, like python.exe, pip3, venv/scripts/activate.bat, can’t be access by the CLI. That would explain some of the reports where a fresh install of python helps resolve the issue.

We are going to foucs on making the error messages more clear so that your system has all the necessary program it needs to run the emulator. Thanks for your patience as we try to improve the error messaging.

A fresh install of python fixed it for me.