uv icon indicating copy to clipboard operation
uv copied to clipboard

Group Policy Blocks UV Tool from Accessing Python Interpreter

Open IliasAarab opened this issue 6 months ago • 10 comments

Description:

I am encountering a persistent issue with the UV tool where it fails to access the Python interpreter due to a group policy restriction. This problem occurs not only when adding packages but also when running scripts.

Error Details:

  • Command: uv add faker and uv run src/uv_prj/__init__.py

  • Error Message:

    error: Failed to query Python interpreter at `\\?\C:\Users\aarabil\Desktop\quick_runs\uv_prj\.venv\Scripts\python.exe`
      Caused by: This program is blocked by group policy. For more information, contact your system administrator. (os error 1260)
    

Steps to Reproduce:

  1. Create a new virtual environment using uv.
  2. Attempt to add a package using uv add faker.
  3. Attempt to run a script using uv run src/uv_prj/__init__.py.

Expected Behavior:

The UV tool should be able to add packages and run scripts without encountering errors related to the Python interpreter.

Actual Behavior:

Both operations fail with an error indicating that the Python interpreter is blocked by group policy.

Environment:

  • OS: Windows
  • UV Tool Version: 0.3.2 (c5440001c 2024-08-23) (installed with pip within a Conda env)
  • Python Version: 3.12 (within a Conda env)
  • Virtual Environment Location: C:\Users\aarabil\Desktop\quick_runs\uv_prj\.venv\

Additional Information:

The error suggests that the group policy settings on the system are preventing the UV tool from accessing the Python interpreter. I am wondering how others deal with this issue within a corporate environment?

IliasAarab avatar Aug 24 '24 14:08 IliasAarab