Python DNS module import error

后端 未结 13 1666
失恋的感觉
失恋的感觉 2020-12-03 16:39

I have been using python dns module.I was trying to use it on a new Linux installation but the module is not getting loaded. I have tried to clean up and install but the ins

13条回答
  •  孤街浪徒
    2020-12-03 17:31

    Very possible the version of pip you're using isn't installing to the version of python you're using. I have a box where this is the case...

    try:

    which python
    
    python --version
    
    pip -V
    

    If it looks like pip doesn't match your python, then you probably have something like the multiple versions of python and pip I found on my box...

    [root@sdpipeline student]# locate bin/pip
    
    /home/student/class/bin/pip
    
    /home/student/class/bin/pip-2.7
    
    /usr/bin/pip
    
    /usr/bin/pip-python
    

    As long as I use /home/student/class/bin/pip (2.7 that matches my python version on that box), then my imports work fine.

    You can also try installing pip from source: http://www.pip-installer.org/en/latest/installing.html

    There's probably a better way to do this, I'm still learning my way around too, but that's how I solved it -- hope it helps!

提交回复
热议问题