diff --git a/pulsar/client/util.py b/pulsar/client/util.py
index 917a9e82c266dbda02bd560a18c67617f0bcfafd..9edda1a0b40273c786156c3bc199355d27ba93f2 100644
--- a/pulsar/client/util.py
+++ b/pulsar/client/util.py
@@ -75,6 +75,8 @@ def copy(source, destination):
     source = os.path.abspath(source)
     destination = os.path.abspath(destination)
     if source != destination:
+        if not os.path.exists(os.path.dirname(destination)):
+            os.makedirs(os.path.dirname(destination))
         shutil.copyfile(source, destination)