Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
ipolat
Explorer

Python tool for exporting/importing a policy package failure cpapi module not import

Hello everyone,

R80.30 We have a checkpoint management server. And we need to export the policy package. For this, we used the blog linked below.

"https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Python-tool-for-exporting-importi... "
However, we provided all the prerequisites mentioned on the blog and when we first ran the script we got the error on the screen. What is the cause of the error.

 

failures.png

0 Kudos
3 Replies
PhoneBoy
Admin
Admin

That looks like you haven't installed the required Python module as instructed in the README.

0 Kudos
ipolat
Explorer

 Hi PhoneBoy,

Thanks for your quickly answer. But we can not install cpapi module into gaia operating system. Do we apply this procedure in checkpoint management sheel or our windows machine?

Thanks Again

0 Kudos
Dan_Cannon
Contributor

it depends on where you are running the script.  If it is locally on your machine then install the cpapi as per the readme and test again.

but if it's on the management you need to be careful to follow the below instructions and make sure you add the path variable.  Otherwise the script will fail.

SDK usage from a management machine
Follow the instructions above in the "Download the repository" section, to download the repository but do not run pip install .

After the downloading, copy the SDK to the machine (use scp, WinSCP or similar tool).

Configure your environment variables

export PYTHONPATH=$PYTHONPATH:<“CP-SDK” FULL PATH>


For example, if you copied the SDK to the path “/home/admin/” the command will be:


export PYTHONPATH=$PYTHONPATH:/home/admin/cp_mgmt_api_python_sdk/

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82
    CheckMates Events