question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3 on CentOS 7, "ImportError: No module named 'requests'" (Missing dependency)

See original GitHub issue

Description of Issue/Question

Fresh installation of salt 2018.3.3-1 on a freshly-installed and fully updated CentOS 7.

When starting salt-master on CentOS 7.6.1810 using the _https://repo.saltstack.com/py3/redhat/7/$basearch/latest_repository (RPM), the following occurs during startup:

[DEBUG   ] Failed to import runners vault:
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/salt/loader.py", line 1514, in _load_module
    mod = imp.load_module(mod_namespace, fn_, fpath, desc)
  File "/usr/lib64/python3.4/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib64/python3.4/imp.py", line 171, in load_source
    module = methods.load()
  File "<frozen importlib._bootstrap>", line 1220, in load
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/usr/lib/python3.4/site-packages/salt/runners/vault.py", line 15, in <module>
    import requests
ImportError: No module named 'requests'

(startup continues; non-fatal)

Manually performing a yum install python34-requests before starting salt-master, however, leads to the ImportError not showing up. Probably just a missed dependency; should be a quick fix. 😃

Setup

[root@salttest-server ~]# sed -re '/^[[:space:]]*(#|$)/d' /etc/salt/master
interface: '::'
ipv6: True
show_jid: True
cli_summary: True
con_cache: True
keysize: 4096
hash_type: sha512

Steps to Reproduce Issue

See above.

Versions Report

Salt Version:
           Salt: 2018.3.3
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: unknown
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.4.9 (default, Aug 14 2018, 21:28:57)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.4.2
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.6.1810 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-862.el7.x86_64
         system: Linux
        version: CentOS Linux 7.6.1810 Core

Installed salt RPMs:

[root@salttest-server ~]# rpm -qa | egrep '^salt'
salt-2018.3.3-1.el7.noarch
salt-api-2018.3.3-1.el7.noarch
salt-py3-repo-latest-2.el7.noarch
salt-master-2018.3.3-1.el7.noarch
salt-cloud-2018.3.3-1.el7.noarch
salt-minion-2018.3.3-1.el7.noarch
salt-syndic-2018.3.3-1.el7.noarch
salt-ssh-2018.3.3-1.el7.noarch

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
johnnybuboniccommented, Jan 14, 2019

you got it, closing. fantastic turnaround.

0reactions
johnnybuboniccommented, Jan 14, 2019

@dmurphy18 no worries; i have it installed just fine currently and this system isn’t even in prod yet. 😃 appreciate the heads-up though!

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - ImportError: No module named requests
Requests is not a built in module (does not come with the default python installation), so you will have to install it: OSX/Linux....
Read more >
[Fixed] ModuleNotFoundError: No module named 'requests'
Quick Fix: Python raises the ImportError: No module named 'requests' when it cannot find the library requests . The most frequent source of...
Read more >
Fix ModuleNotFoundError (No Module Named Requests ...
python #error #fix #fixed #howto Hey guys in this tutorial let's try to fix ModuleNotFoundError No module named error in cases where the ......
Read more >
Importerror: no module named requests - Lets Fix step by step
Importerror : no module named requests error comes into the picture when the requests module not available or uninstalled.
Read more >
CentOS 7, Ansible and the end of Python 2
An increasing number of packages are Python 3 only, and others are not receiving updates for Python 2. Ansible's pip module uses the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found