Bug 1757179 - ModuleNotFoundError: No module named 'yaml' when running tpm2_ptool
Summary: ModuleNotFoundError: No module named 'yaml' when running tpm2_ptool
Alias: None
Product: Fedora
Classification: Fedora
Component: tpm2-pkcs11
Version: 31
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Jakub Jelen
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: IoT
TreeView+ depends on / blocked
Reported: 2019-09-30 18:37 UTC by nicolasoliver03
Modified: 2019-11-15 21:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-11-15 21:26:50 UTC

Attachments (Terms of Use)

Description nicolasoliver03 2019-09-30 18:37:12 UTC
Description of problem:
ModuleNotFoundError: No module named 'yaml' when running tpm2_ptool

Version-Release number of selected component (if applicable):

How reproducible:
dnf install tpm2-pkcs11-tools
tpm2_ptool init --pobj-pin=mypobjpin --path=~/tmp

Steps to Reproduce:
1. dnf install tpm2-pkcs11-tools
2. tpm2_ptool init --pobj-pin=mypobjpin --path=~/tmp
3. crash

Actual results:
Traceback (most recent call last):
  File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.7/site-packages/tpm2_pkcs11/tpm2_ptool.py", line 5, in <module>
    from .commandlets_store import InitCommand  # pylint: disable=unused-import
  File "/usr/lib/python3.7/site-packages/tpm2_pkcs11/commandlets_store.py", line 6, in <module>
    import yam

Expected results:
Created a primary object of id: 1

Additional info:

Comment 1 Jakub Jelen 2019-10-11 09:01:15 UTC
Thank you for the report.

If I read your bug report correctly, you are saying you are missing the python3-pyyaml dependency in the tools subpackage package.

If I see right, the latest version of tpm2-pkcs11 already provides the requires.txt so the requirements should get resolved automatically, but that is not what I see when I try to build it locally on my Fedora 30.

So I will update to the current snapshot and add explicit requires.

Comment 2 Fedora Update System 2019-10-11 12:42:29 UTC
FEDORA-2019-ce5d61669f has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-ce5d61669f

Comment 3 Fedora Update System 2019-10-11 16:53:57 UTC
tpm2-pkcs11-0-0.8.20191011git0b7ceff.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-ce5d61669f

Comment 4 nicolasoliver03 2019-11-15 21:26:13 UTC
Works fine now!

  [root@fedora-server-1 ~]# rpm -qa tpm2-pkcs11-tools

  [root@fedora-server-1 ~]# tpm2_ptool init --pobj-pin=mypobjpin --path=~/tmp
  Created a primary object of id: 1


Note You need to log in before you can comment on or make changes to this bug.