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
I installed dnspython 1.11.1 on my Ubuntu box using pip install dnspython
. I was able to import the dns module without any problems
I am using Python 2.7.4 on an Ubuntu based server.
I installed DNSpython 2.0.0 from the github source, but running 'pip list' showed the old version of dnspython 1.2.0
It only worked after I ran 'pip uninstall dnspython' which removed the old version leaving just 2.0.0 and then 'import dns' ran smoothly
One possible reason here might be your script have wrong shebang (so it is not using python from your virtualenv). I just did this change and it works:
-#!/bin/python
+#!/usr/bin/env python
Or ignore shebang and just run the script with python in your venv:
$ python your_script.py
I ran into the same issue with dnspython.
My solution was to build the source from their official GitHub project.
So my steps were:
git clone https://github.com/rthalley/dnspython
cd dnspython/
python setup.py install
After doing this, I was able to import the dns
module.
EDIT
It seems the pip install doesn't work for this module. Install from source as described.
On Debian 7 Wheezy, I had to do:
pip install --upgrade dnspython
even if python-dns package was installed.
This issue can be generated by Symantec End Point Protection (SEP). And I suspect most EPP products could potentially impact your running of scripts.
If SEP is disabled, the script will run instantly.
Therefore you may need to update the SEP policy to not block python scripts accessing stuff.