TheKoguryo's Tech Blog

 Version 2024.05.05

Warning

This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.

14.1.1.1 Installing OCI CLI on Windows

  1. Run PowerShell in Administrator Mode

  2. Run the following command to configure remote execution policy in PowerShell

    Set-ExecutionPolicy RemoteSigned
    
    • Reply Y for policy change
  3. Run the following to run the installation script

    powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1 '))"
    
    • Python installed: Y response
      • After checking the installation path, set
      • Y response when checking for new version update of CLI
      • Y response when requesting to add CLI to PATH
  4. Since the newly registered PATH may not be applied to the current window after installation, open a new PowerShell and run the OCI CLI.

  5. Installation example

    PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned
    
    실행 규칙 변경                                                                                           
    실행 정책은 신뢰하지 않는 스크립트로부터 사용자를 보호합니다. 실행 정책을 변경하면 about_Execution_Policies 도움말
    항목(https://go.microsoft.com/fwlink/?LinkID=135170)에 설명된 보안 위험에 노출될 수 있습니다. 실행 정책을
    변경하시겠습니까?
    [Y](Y)  [A] 모두 예(A)  [N] 아니요(N)  [L] 모두 아니요(L)  [S] 일시 중단(S)  [?] 도움말 (기본값은 "N"): Y
    PS C:\WINDOWS\system32> powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1'))"
    
            ******************************************************************************
            You have started the OCI CLI Installer in interactive mode. If you do not wish
            to run this in interactive mode, please include the -AcceptAllDefaults option.
            If you have the script locally and would like to know more about
            input options for this script, then you can run:
            help .\install.ps1
            If you would like to know more about input options for this script, refer to:
            https://github.com/oracle/oci-cli/blob/master/scripts/install/README.rst
            ******************************************************************************
    자세한 정보 표시: No valid Python installation found.
    
    Python is required to run the CLI.
    Install Python now? (Entering "n" will exit the installation script)
    [Y] Yes  [N] No  [?] 도움말 (기본값은 "Y"): Y
    자세한 정보 표시: Downloading Python...
    자세한 정보 표시: Download Complete! Installer executable written to: C:\Users\thekoguryo\AppData\Local\Temp\tmp18AF.tmp.exe
    자세한 정보 표시: Installing Python to C:\Users\thekoguryo\Python...
    자세한 정보 표시: Successfully installed Python!
    자세한 정보 표시: Downloading install script to C:\Users\thekoguryo\AppData\Local\Temp\tmpC089.tmp
    자세한 정보 표시: C:\Users\thekoguryo\Python False    False
    자세한 정보 표시: Using Python executable: C:\Users\thekoguryo\Python\python.exe to run install script...
    자세한 정보 표시: Arguments to python script: "C:\Users\thekoguryo\AppData\Local\Temp\tmpC089.tmp"
    -- Verifying Python version.
    -- Python version 3.8.5 okay.
    
    ===> In what directory would you like to place the install? (leave blank to use 'C:\Users\thekoguryo\lib\oracle-cli'):
    -- Creating directory 'C:\Users\thekoguryo\lib\oracle-cli'.
    -- We will install at 'C:\Users\thekoguryo\lib\oracle-cli'.
    
    ===> In what directory would you like to place the 'oci.exe' executable? (leave blank to use 'C:\Users\thekoguryo\bin'):
    -- Creating directory 'C:\Users\thekoguryo\bin'.
    -- The executable will be in 'C:\Users\thekoguryo\bin'.
    
    ===> In what directory would you like to place the OCI scripts? (leave blank to use 'C:\Users\thekoguryo\bin\oci-cli-scripts'):
    -- Creating directory 'C:\Users\thekoguryo\bin\oci-cli-scripts'.
    -- The scripts will be in 'C:\Users\thekoguryo\bin\oci-cli-scripts'.
    
    ===> Currently supported optional packages are: ['db (will install cx_Oracle)']
    What optional CLI packages would you like to be installed (comma separated names; press enter if you don't need any optional packages)?:
    -- The optional packages installed will be ''.
    -- Trying to use python3 venv.
    -- Executing: ['C:\\Users\\thekoguryo\\Python\\python.exe', '-m', 'venv', 'C:\\Users\\thekoguryo\\lib\\oracle-cli']
    -- Executing: ['C:\\Users\\thekoguryo\\lib\\oracle-cli\\Scripts\\python.exe', '-m', 'pip', 'install', '--upgrade', 'pip']
    Collecting pip
      Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
         |████████████████████████████████| 1.7 MB 6.8 MB/s
    Installing collected packages: pip
      Attempting uninstall: pip
        Found existing installation: pip 20.1.1
        Uninstalling pip-20.1.1:
          Successfully uninstalled pip-20.1.1
    Successfully installed pip-21.3.1
    -- Executing: ['C:\\Users\\thekoguryo\\lib\\oracle-cli\\Scripts\\pip', 'install', '--cache-dir', 'C:\\Users\\thekoguryo\\AppData\\Local\\Temp\\tmp7z8s7qbi', 'wheel', '--upgrade']
    Collecting wheel
      Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
    Installing collected packages: wheel
    Successfully installed wheel-0.37.1
    -- Executing: ['C:\\Users\\thekoguryo\\lib\\oracle-cli\\Scripts\\pip', 'install', '--cache-dir', 'C:\\Users\\thekoguryo\\AppData\\Local\\Temp\\tmp7z8s7qbi', 'oci_cli', '--upgrade']
    Collecting oci_cli
      Downloading oci_cli-3.4.2-py3-none-any.whl (23.8 MB)
         |████████████████████████████████| 23.8 MB 6.8 MB/s
    Collecting cryptography<=3.4.7,>=3.2.1
      Downloading cryptography-3.4.7-cp36-abi3-win_amd64.whl (1.6 MB)
         |████████████████████████████████| 1.6 MB ...
    Collecting pyOpenSSL==19.1.0
      Downloading pyOpenSSL-19.1.0-py2.py3-none-any.whl (53 kB)
         |████████████████████████████████| 53 kB 955 kB/s
    Collecting click==7.1.2
      Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
         |████████████████████████████████| 82 kB 5.8 MB/s
    Collecting six>=1.15.0
      Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
    Collecting oci==2.54.0
      Downloading oci-2.54.0-py2.py3-none-any.whl (12.2 MB)
         |████████████████████████████████| 12.2 MB 6.4 MB/s
    Collecting arrow>=1.0.0
      Downloading arrow-1.2.1-py3-none-any.whl (63 kB)
         |████████████████████████████████| 63 kB ...
    Collecting jmespath==0.10.0
      Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
    Collecting pytz>=2016.10
      Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
         |████████████████████████████████| 503 kB 6.8 MB/s
    Collecting certifi                                                                                                        Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)                                                                |████████████████████████████████| 149 kB ...                                                                      Collecting PyYAML<6,>=5.4                                                                                                 Downloading PyYAML-5.4.1-cp38-cp38-win_amd64.whl (213 kB)                                                                  |████████████████████████████████| 213 kB ...
    Collecting terminaltables==3.1.0
      Downloading terminaltables-3.1.0.tar.gz (12 kB)
      Preparing metadata (setup.py) ... done
    Collecting python-dateutil<3.0.0,>=2.5.3
      Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
         |████████████████████████████████| 247 kB ...
    Collecting circuitbreaker<2.0.0,>=1.3.1
      Downloading circuitbreaker-1.3.2.tar.gz (7.9 kB)
      Preparing metadata (setup.py) ... done
    Collecting cffi>=1.12
      Downloading cffi-1.15.0-cp38-cp38-win_amd64.whl (179 kB)
         |████████████████████████████████| 179 kB 6.4 MB/s
    Collecting pycparser
      Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
         |████████████████████████████████| 118 kB 6.8 MB/s
    Building wheels for collected packages: terminaltables, circuitbreaker
      Building wheel for terminaltables (setup.py) ... done
      Created wheel for terminaltables: filename=terminaltables-3.1.0-py3-none-any.whl size=15355 sha256=a28562e8abfb78420764123ed4224e44167c5bc969996d1745bc5c1116b2d8b2
      Stored in directory: c:\users\thekoguryo\appdata\local\temp\tmp7z8s7qbi\wheels\08\8f\5f\253d0105a55bd84ee61ef0d37dbf70421e61e0cd70cef7c5e1
      Building wheel for circuitbreaker (setup.py) ... done
      Created wheel for circuitbreaker: filename=circuitbreaker-1.3.2-py3-none-any.whl size=6017 sha256=ac910cffc04f0ed6e90f2b65da6241bdaf9848fcf160dc03b1ec821db75600b8
      Stored in directory: c:\users\thekoguryo\appdata\local\temp\tmp7z8s7qbi\wheels\97\d2\3d\8ad7bff00d846a770cdc0ed208f0fae657c983e675d658c1d5
    Successfully built terminaltables circuitbreaker
    Installing collected packages: pycparser, cffi, six, cryptography, pytz, python-dateutil, pyOpenSSL, circuitbreaker, certifi, terminaltables, PyYAML, oci, jmespath, click, arrow, oci-cli
    Successfully installed PyYAML-5.4.1 arrow-1.2.1 certifi-2021.10.8 cffi-1.15.0 circuitbreaker-1.3.2 click-7.1.2 cryptography-3.4.7 jmespath-0.10.0 oci-2.54.0 oci-cli-3.4.2 pyOpenSSL-19.1.0 pycparser-2.21 python-dateutil-2.8.2 pytz-2021.3 six-1.16.0 terminaltables-3.1.0
    
    ===> Modify PATH to include the CLI and enable tab completion in PowerShell now? (Y/n): Y
    --
    -- ** Close and re-open PowerShell to reload changes to your PATH **
    -- In order to run the autocomplete script, you may also need to set your PowerShell execution policy to allow for running local scripts (as an Administrator run Set-ExecutionPolicy RemoteSigned in a PowerShell prompt)
    --
    -- Installation successful.
    -- Run the CLI with C:\Users\thekoguryo\bin\oci.exe --help
    자세한 정보 표시: Successfully installed OCI CLI!
    PS C:\WINDOWS\system32>
    


As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.

Last updated on 24 Dec 2018