I'm running Python 3.4 on an Ubuntu VM. I'm using a virtual environment for the project I'm currently working on. I tried installing DNSPython using both pip install and downloading the tar from their webpage. I get the following errors when trying to install:
copying build/lib/dns/util.py -> /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/util.py to util.cpython-34.pyc
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/tsig.py to tsig.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/tsig.py", line 96
long_time = time + 0L
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/dnssec.py to dnssec.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/dnssec.py", line 121
raise UnsupportedAlgorithm, 'unsupported algorithm "%s"' % algorithm
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/rdatatype.py to rdatatype.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/rdatatype.py", line 213
text = 'TYPE' + `value`
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/rdataclass.py to rdataclass.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/rdataclass.py", line 103
text = 'CLASS' + `value`
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/entropy.py to entropy.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/entropy.py", line 104
if size > 4294967296L:
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/zone.py to zone.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/zone.py", line 874
except dns.exception.SyntaxError, detail:
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/edns.py to edns.cpython-34.pyc
Sorry: TabError: inconsistent use of tabs and spaces in indentation (edns.py, line 117)
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/name.py to name.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/name.py", line 183
h = 0L
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/query.py to query.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/query.py", line 118
except select.error, e:
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/renderer.py to renderer.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/renderer.py", line 221
ednsflags &= 0xFF00FFFFL
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/message.py to message.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/message.py", line 176
return '<DNS message, ID ' + `self.id` + '>'
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/ttl.py to ttl.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/ttl.py", line 39
total = 0L
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/rdtypes/ANY/LOC.py to LOC.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/rdtypes/ANY/LOC.py", line 22
_pows = (1L, 10L, 100L, 1000L, 10000L, 100000L, 1000000L, 10000000L,
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/node.py to node.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/node.py", line 172
raise ValueError, 'replacement is not an rdataset'
^
SyntaxError: invalid syntax
byte-compiling /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/tokenizer.py to tokenizer.cpython-34.pyc
File "/home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dns/tokenizer.py", line 491
if value < 0 or value > 4294967296L:
^
SyntaxError: invalid syntax
running install_egg_info
Writing /home/anton/JMWebStuff/JMWebStuff/lib/python3.4/site-packages/dnspython3-1.11.1.egg-info
I though this might be related to python 3 vs. python 2 issues, but I specifically downloaded the python 3 version. These seem like real errors, however I haven't seen anyone else reporting these kinds of errors. Thanks for any help.
Realized that I was, in fact, somehow still downloading the python 2.x version. For others who run in to the same issue: use pip install dnspython3, not dnspython
If you want to install dns for python3 use: sudo pip3 (not pip !!) install dnspython3. Bye!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With