Installing FCU
A note on the use of pip and Python commands:
If you have an activated virtual environment, you can use the commands provided in the instructions below. If you do not activate your virtual environment, you must use the full or relative path for pip and Python commands.
The following example demonstrates how to run the same command in a virtual environment and on your physical machine:
-
On your physical machine or if you activate your virtual environment:
pip install fcu -f c:\extracted-fcu-archive\fcu --upgrade
-
Using a virtual environment that is not activated:
-
In Windows:
[your Python installation path]\Scripts\pip install fcu -f c:\extracted-fcu-archive\fcu --upgrade
-
In Linux:
[your Python installation path]/bin/pip install fcu -f ~/extracted-fcu-archive/fcu --upgrade
-
-
NOTE! FCU does not currently work with Python3.10.
- If your distribution has Python 3.10 as the default one - we recommend installing
pyenv
withvirtualenv
support and installing for example latest Python 3.8.x with and using that. - A
virtualenv
alone will not fix the Python 3.10 API breakages.
- If your distribution has Python 3.10 as the default one - we recommend installing
-
Download the FCU archive:
- Select Device identity > Factory from the Device Management Portal side menu.
- Click Download.
-
Set up a virtual environment. Working in a virtual environment is optional, but it is the recommended procedure.
-
Extract the FCU archive into a directory of your choice. The examples below use
extracted-fcu-archive
. -
Install the FCU Python package from the
.whl
file.- In Windows, run:
pip install fcu -f c:\extracted-fcu-archive\fcu --upgrade
- In Linux, run:
pip install fcu -f ~/extracted-fcu-archive/fcu --upgrade
- In Windows, run:
-
Alternatively, if you make changes to the source files, you can install the FCU Python package based on the FCU source files.
-
In Windows, run:
pip install -e c:\extracted-fcu-archive\fcu\sources --upgrade
-
In Linux, run:
pip install fcu -e ~/extracted-fcu-archive/fcu/sources --upgrade
Note: Use the
--upgrade
flag to override an existing FCU installation. After installing, you can verify the FCU version using thepip list
command, which prints all installed Python libraries under the FCU entry.Tip: If an internet connection is available, running the command installs the FCU package and its required Python libraries at the same time. If an internet connection is not available, you must install the Python libraries yourself before running the FCU installation.
-
After installing FCU, you must integrate FCU with your factory tool and configure FCU.
Note: If you intend to use FCU as a certificate authority, you must set it up manually. You can do this at any time, but we describe how to do this as part of the installation process in the next section.
Setting up a virtual environment for FCU
We recommend installing FCU on an isolated virtual environment, probably the same one your factory tool uses, to avoid conflicts with any other Python packages installed on your system.
Tip: For more details on virtual environments, see virtualenv.
Note: The process of setting up a virtual environment, described below, involves downloading and installing software from the internet. Be sure to carefully examine downloaded content and scan it for malware or viruses.
To create a new virtual environment for FCU:
-
Download Python version 3.5-3.7:
-
In Windows:
-
Install Python. For instructions, please see the Python documentation.
-
Install the virtualenv:
py -3 -m pip install virtualenv
.
Tip: Some Windows versions lack a required runtime package for Python (
vcruntime140.dll
, or similar). If you encounter this problem, you can overcome it by installing Microsoft Visual C++ 2015 Redistributable. -
-
In Linux,
-
Install Python. For instructions, please see the Python documentation.
-
Install "pip":
curl https://bootstrap.pypa.io/get-pip.py -O && sudo python3 get-pip.py
.Tip: If needed, see full installation instructions in the pip documentation.
-
Install virtualenv:
sudo python3 -m pip install virtualenv
.Tip: If needed, see the full installation instructions.
-
-
-
Extract the downloaded archive to a location of your choice.
We will assume:
C:\extracted-fcu-archive\fcu
for Windows.~/extracted-fcu-archive/fcu
for Linux.
-
Create a virtual environment in a location of your choice. The examples below use
c:\extracted-fcu-archive\fcu
for Windows and~/extracted-fcu-archive/fcu
for Linux.-
In Windows, run:
py -3 -m virtualenv C:\extracted-fcu-archive\fcu-venv
-
In Linux, run:
python3 -m virtualenv ~/extracted-fcu-archive/fcu-venv
-
-
Activate your virtual environment:
Navigate to the virtual environment directory you created and run the
activate
command:-
In Windows, run:
C:\extracted-fcu-archive\fcu-venv\Scripts\activate
-
In Linux, run:
~/extracted-fcu-archive/fcu-venv/source bin/activate
-