OpenAdaptAI / OpenAdapt

Open Source Generative Process Automation (i.e. Generative RPA). AI-First Process Automation with Large ([Language (LLMs) / Action (LAMs) / Multimodal (LMMs)] / Visual Language (VLMs)) Models
https://www.OpenAdapt.AI
MIT License
885 stars 115 forks source link

[Bug]: manual installation on Windows fails on `poetry shell` #626

Open abrichr opened 5 months ago

abrichr commented 5 months ago

Describe the bug

When running manual install steps on Windows 11 emulated in UTM on a MacOS host, at poetry shell:

File C: \Users\user\AppData\Local\pypoetry\Cache\virtualenvs\openadapt-yEkGQRTF-py3.10\Scripts\activate.ps1 cannot be
Loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo
: SecurityError: (:) I, ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess

To fix, run in every new powershell terminal:

Set-ExecutionPolicy RemoteSigned -Scope Process -Force

Or, with admin privileges, run this once:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

This should be documented.

To Reproduce

Run manual installation steps on Windows 11 inside UTM.

abrichr commented 3 months ago

Reproduced on fresh Windows 11 machine:

image

Workaround should be automated or at least documented in README.md.

abrichr commented 3 months ago

poetry run postinstall fails:

      C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\openadapt-0Ma3Pw0X-py3.10\lib\site-packages\torch\utils\cpp_extension.py:359: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
      building 'detectron2._C' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for detectron2
  Running setup.py clean for detectron2
  Building wheel for fvcore (setup.py) ... done
  Created wheel for fvcore: filename=fvcore-0.1.5.post20221221-py3-none-any.whl size=61413 sha256=c37ac74942def579f478b94b735ccbd821e4ca7359e01401163e1e5b9da0cc2c
  Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\01\c0\af\77c1cf53a1be9e42a52b48e5af2169d40ec2e89f7362489dd0
  Building wheel for antlr4-python3-runtime (setup.py) ... done
  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144578 sha256=92e9b701d6e390e9abafc3f0f768e7550beb4d8858aed050380955fe18c7e850
  Stored in directory: c:\users\user\appdata\local\pip\cache\wheels\12\93\dd\1f6a127edc45659556564c5730f6d4e300888f4bca2d4c5a88
Successfully built fvcore antlr4-python3-runtime
Failed to build detectron2
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (detectron2)
Error installing Detectron2: Command '['C:\\Users\\user\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\openadapt-0Ma3Pw0X-py3.10\\Scripts\\python.exe', '-m', 'pip', 'install', 'git+https://github.com/facebookresearch/detectron2.git', '--no-build-isolation']' returned non-zero exit status 1.

Downloading and installing via the link worked.

abrichr commented 3 months ago
PS C:\openadapt\openadapt> alembic upgrade head
alembic : The term 'alembic' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ alembic upgrade head
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (alembic:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

@Animesh404 @KIRA009 have you seen this before?

Edit: I got it working by creating a new powershell window (not elevated to admin) and running the following before poetry shell:

Set-ExecutionPolicy RemoteSigned -Scope Process -Force

This should be documented.

absha03 commented 3 months ago

This worked for me, on windows 11

: First, Open PowerShell with Run as Administrator. Then, run this command in PowerShell Set-ExecutionPolicy -ExecutionPolicy RemoteSigned After that type Y and press Enter.