4.2.2.5.4 OML4Pyクライアント・パッケージのインストール

Windows向けOML4Pyクライアントをインストールする手順です。

WindowsにOML4Pyクライアント・パッケージをインストールするステップです

OML4Pyクライアント・インストール・ファイルのダウンロードおよび抽出

OML4Pyクライアント・インストールファイルをダウンロードして抽出するには、次を実行します。

  1. クライアント・インストールzipファイルをダウンロードします。
    1. Oracle Technology Networkの「Oracle Machine Learning for Python Downloads」ページにアクセスします。
    2. ライセンス契約に同意します。
    3. Oracle Machine Learning for Python Client Install on Windowsを選択します。
    4. zipファイルをアクセス可能なディレクトリに保存します。
  2. zipファイルをダウンロードしたディレクトリに移動し、ファイルを解凍します。

    unzip oml4py_windows_client.zip

    clientというサブディレクトリに内容が抽出され、次の4つのファイルが格納されています。

    • client/client.bat
    • client/libmmd.dll
    • client/oml-2.1-cp313-cp313-win_amd64.whl
    • client/sitecustomize.py

OML4Pyクライアントをインストールします

OMl4Pyクライアントは、batスクリプトを使用しても、スクリプトを使用しなくてもインストールできます。

  1. batスクリプトを使用したOML4Pyクライアントのインストール

    1. クライアント・フォルダ内にあるすべてのファイルを読取り専用に設定します。
      icacls "client\*" /inheritance:r 
      icacls "client\*" /remove:g Administrators SYSTEM %USERNAME% 
      icacls "client\*" /grant:r %USERNAME%:RX Administrators:RX SYSTEM:RX
    2. OML4Pyのインストール:

      OML4Pyをインストールするには、次のコマンドを実行します:
      cd client 
      client.bat -i
    3. OML4Pyのアンインストール:

      OML4Pyをアンインストールするには、次のコマンドを実行します:
      client.bat -u
    クライアント・インストール・スクリプトのガイダンス
    -h、--help : -hまたは--helpは、インストールbatスクリプトの使用方法を示します。
    client -h

    -i、--install: -iまたは--installは、OML4Pyクライアントをインストールします。--proxyは、pipインストール用のHTTPプロキシを指定します。

    client.bat -i --proxy=www.example.com:<port>

    --dep-pkgs: 事前作成済の依存パッケージが格納されているフォルダを指定します。pipは、まず--dep-pkgsフォルダから欠落している依存パッケージをインストールします。

    client -i --dep-pkgs C:\Users\<YourUsername>\Desktop\oml4py\client\supporting

    --target: --targetは、指定されたターゲット・ディレクトリにクライアントをインストールします。

    client -i --target C:\Users\<YourUsername>\Desktop\oml4py\client\install_test

    -y: -yは、プロンプトを一切表示せずに、常にスクリプトの続行を承認します。

    client -i -y --target C:\Users\<YourUsername>\Desktop\oml4py\client\install_test

    --no-deps: --no-depsは、依存パッケージのチェックおよびインストールをスキップします。

    client -i --no-deps

    -uまたは--uninstall: -uまたは--uninstallは、OML4Pyクライアントをアンインストールします。

    client -u

    例:

    • '--proxy'オプションを指定したインストール
      • client -i --proxy http://www.-proxy.example.com:80
      • client -i -y --proxy http://www.-proxy.example.com:80
      • client -i -–no-deps --proxy http://www.-proxy.example.com:80
    • '--dep-pkgs'オプションを指定したインストール
      • client -i --dep-pkgs C:\Users\<YourUsername>\Desktop\oml4py\client\supporting
      • client -i –y --dep-pkgs C:\Users\<YourUsername>\Desktop\oml4py\client\supporting
      • client -i -–no-deps --dep-pkgs C:\Users\<YourUsername>\Desktop\oml4py\client\supporting
    • '--target'オプションを指定したインストール
      • client -i --target C:\Users\<YourUsername>\Desktop\oml4py\client\install_test --proxy http://www.-proxy.example.com:80
      • client -i --target C:\Users\<YourUsername>\Desktop\oml4py\client\install_test --dep-pkgs C:\Users\<YourUsername>\Desktop\oml4py\client\supporting
    • '-y'オプションを指定したアンインストール
      • client -u
      • client -u -y
  2. スクリプトを使用しないOML4Pyクライアントのインストール。

    依存関係やPythonの要件を確認しない場合、またはインストール・フォルダに対するアクセス制御を設定しない場合は、pip3を使用して.whlファイルからパッケージを直接インストールできます。

    1. クライアント・フォルダからoml whlをインストールします:

      pip3 install --no-deps client/oml-2.1-cp313-cp313-win_amd64.whl
    2. libmmd.dllを%PYTHONHOME%にコピーします:

      cp client/libmmd.dll %PYTHONHOME%
    3. sitecustomize.pyを%PYTHONHOME%/Lib/site-packages/にコピーします:

      cp client/sitecustomize.py %PYTHONHOME%/Lib/site-packages/