Python Tutorial
Below error 'No module named requests' is raised if requests module is not installed on the machine
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named requests fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"\", line 113, in \n File \" \", line 105, in _ansiballz_main\n File \" \", line 48, in invoke_module\n File \"/tmp/ansible_beaker_provisioner_payload_2knXVT/__main__.py\", line 25, in \nImportError: No module named requests\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
How to install requests module in RHEL 7 / Fedora / Centos?
$ sudo yum install python-requests Fedora Modular 29 - x86_64 6.5 kB/s | 6.2 kB 00:00 Fedora Modular 29 - x86_64 - Updates 6.1 kB/s | 5.9 kB 00:00 Fedora 29 - x86_64 - Updates 5.7 kB/s | 5.7 kB 00:00 Fedora 29 - x86_64 6.4 kB/s | 6.0 kB 00:00 google-chrome 7.4 kB/s | 1.3 kB 00:00 Dependencies resolved. ============================================================================================================================================================================= Package Architecture Version Repository Size ============================================================================================================================================================================= Installing: python2-requests noarch 2.20.0-1.fc29 updates 116 k Installing dependencies: python2-urllib3 noarch 1.24.3-1.fc29 updates 169 k python2-backports x86_64 1.0-15.fc29 fedora 9.7 k python2-backports-ssl_match_hostname noarch 3.5.0.1-10.fc29 fedora 16 k python2-chardet noarch 3.0.4-7.fc29 fedora 188 k python2-idna noarch 2.7-3.fc29 fedora 105 k python2-ipaddress noarch 1.0.18-5.fc29 fedora 39 k python2-pysocks noarch 1.6.8-4.fc29 fedora 33 k Transaction Summary ============================================================================================================================================================================= Install 8 Packages Total download size: 676 k Installed size: 2.8 M Is this ok [y/N]: y Downloading Packages: (1/8): python2-backports-1.0-15.fc29.x86_64.rpm 34 kB/s | 9.7 kB 00:00 (2/8): python2-backports-ssl_match_hostname-3.5.0.1-10.fc29.noarch.rpm 132 kB/s | 16 kB 00:00 (3/8): python2-urllib3-1.24.3-1.fc29.noarch.rpm 322 kB/s | 169 kB 00:00 (4/8): python2-requests-2.20.0-1.fc29.noarch.rpm 202 kB/s | 116 kB 00:00 (5/8): python2-idna-2.7-3.fc29.noarch.rpm 735 kB/s | 105 kB 00:00 (6/8): python2-chardet-3.0.4-7.fc29.noarch.rpm 700 kB/s | 188 kB 00:00 (7/8): python2-ipaddress-1.0.18-5.fc29.noarch.rpm 343 kB/s | 39 kB 00:00 (8/8): python2-pysocks-1.6.8-4.fc29.noarch.rpm 200 kB/s | 33 kB 00:00 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 235 kB/s | 676 kB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python2-pysocks-1.6.8-4.fc29.noarch 1/8 Installing : python2-ipaddress-1.0.18-5.fc29.noarch 2/8 Installing : python2-idna-2.7-3.fc29.noarch 3/8 Installing : python2-chardet-3.0.4-7.fc29.noarch 4/8 Installing : python2-backports-1.0-15.fc29.x86_64 5/8 Installing : python2-backports-ssl_match_hostname-3.5.0.1-10.fc29.noarch 6/8 Installing : python2-urllib3-1.24.3-1.fc29.noarch 7/8 Error unpacking rpm package python2-urllib3-1.24.3-1.fc29.noarch Installing : python2-requests-2.20.0-1.fc29.noarch 8/8 error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/urllib3/packages/ssl_match_hostname: cpio: File from package already exists as a directory in system error: python2-urllib3-1.24.3-1.fc29.noarch: install failed Running scriptlet: python2-requests-2.20.0-1.fc29.noarch 8/8 Verifying : python2-requests-2.20.0-1.fc29.noarch 1/8 Verifying : python2-urllib3-1.24.3-1.fc29.noarch 2/8 Verifying : python2-backports-1.0-15.fc29.x86_64 3/8 Verifying : python2-backports-ssl_match_hostname-3.5.0.1-10.fc29.noarch 4/8 Verifying : python2-chardet-3.0.4-7.fc29.noarch 5/8 Verifying : python2-idna-2.7-3.fc29.noarch 6/8 Verifying : python2-ipaddress-1.0.18-5.fc29.noarch 7/8 Verifying : python2-pysocks-1.6.8-4.fc29.noarch 8/8 Installed: python2-requests-2.20.0-1.fc29.noarch python2-backports-1.0-15.fc29.x86_64 python2-backports-ssl_match_hostname-3.5.0.1-10.fc29.noarch python2-chardet-3.0.4-7.fc29.noarch python2-idna-2.7-3.fc29.noarch python2-ipaddress-1.0.18-5.fc29.noarch python2-pysocks-1.6.8-4.fc29.noarch
Linux Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page