Linux Virtual Delivery Agent

Create a Python3 virtual environment

If you are connecting to the network, running the sudo /opt/Citrix/VDA/bin/xdping or /opt/Citrix/VDA/sbin enable_ldaps.sh command can create a Python3 virtual environment. However, if the commands fail to create a Python3 virtual environment, you can create it manually even without a network connection. This article details the prerequisites and steps to create a Python3 virtual environment without a network connection.

Prerequisites

  • You must have administrative privileges to access the /opt/Citrix/VDA/sbin/ctxpython3 directory.
  • The wheel files of Python3 packages are in place. You can download the wheel files from https://pypi.org/.

Create a Python3 virtual environment

Complete the following steps to create a Python3 virtual environment:

  1. Install Python3 dependencies.

    For RHEL:

    yum -y install python36-devel krb5-devel gcc
    <!--NeedCopy-->
    

    Note:

    You might need to enable a particular repository to install some dependencies. For RHEL 7, run the subscription-manager repos --enable rhel-7-server-optional-rpms command. For RHEL 8, run the subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms command.

    For Ubuntu\Debian:

    apt-get -y install python3-dev python3-pip libkrb5-dev
    <!--NeedCopy-->
    

    For SUSE:

    zypper -i -n install python3-devel python3-setuptools krb5-devel gcc libffi48-devel
    <!--NeedCopy-->
    

    Note:

    You might need to enable the SUSE_Linux_Enterprise_Software_Development_Kit_12_SP5_x86_64 repository to install some dependencies.

  2. Create a Python3 virtual environment.

    For RHEL, Ubuntu, Debian:

    python3 -m pip install appdirs distlib importlib-metadata filelock importlib-resources six zipp virtualenv==20.0.0
    
    python3 -m virtualenv /opt/Citrix/VDA/sbin/ctxpython3
    <!--NeedCopy-->
    

    For SUSE:

    python3 -m easy_install pathlib2==2.3.4
    
    python3 -m easy_install appdirs distlib importlib-metadata filelock importlib-resources six zipp virtualenv==20.0.0
    
    python3 -m virtualenv /opt/Citrix/VDA/sbin/ctxpython3
    <!--NeedCopy-->
    
  3. Enter the created Python3 virtual environment.

    source /opt/Citrix/VDA/sbin/ctxpython3/bin/activate
    <!--NeedCopy-->
    
  4. Install LDAPS dependencies.

    For RHEL, Ubuntu, Debian:

    python3 -m pip install cffi cryptography decorator pyasn1 pycparser six gssapi==1.6.2 ldap3==2.8.1
    <!--NeedCopy-->
    

    For SUSE:

    python3 -m easy_install cffi cryptography decorator pyasn1 pycparser six gssapi==1.6.2 ldap3==2.8.1
    <!--NeedCopy-->
    
  5. Install XDPing dependencies.

    For RHEL, Ubuntu, Debian:

    python3 -m pip install decorator netifaces pg8000 psutil pyasn1 scramp termcolor gssapi==1.6.2 ldap3==2.8.1
    
    python3 -m pip install /opt/Citrix/VDA/sbin/ctxpython3/packages/xdping-*.whl
    <!--NeedCopy-->
    

    For SUSE:

    python3 -m easy_install decorator netifaces pg8000 psutil pyasn1 scramp termcolor gssapi==1.6.2 ldap3==2.8.1
    
    python3 -m easy_install /opt/Citrix/VDA/sbin/ctxpython3/packages/xdping-*.whl
    <!--NeedCopy-->
    
  6. Exit the virtual environment.

    deactivate
    <!--NeedCopy-->
    
Create a Python3 virtual environment