move pyyaml to try block due to cyclic dependency