Project

General

Profile

Task #2477

Task #2476: Python 3 support

Cannot import dns

Added by Luke Murphey about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
10/22/2019
Due date:
% Done:

100%


Description

Traceback (most recent call last):
File "src/bin/network_tools_ops_rest_handler.py", line 41, in <module>
from network_tools_app import rest_handler
File "/Users/lmurphey/git/splunk-network-tools/src/bin/network_tools_app/__init__.py", line 40, in <module>
from network_tools_app.ipwhois import IPWhois
File "/Users/lmurphey/git/splunk-network-tools/src/bin/network_tools_app/ipwhois/__init__.py", line 28, in <module>
from .net import Net
File "/Users/lmurphey/git/splunk-network-tools/src/bin/network_tools_app/ipwhois/net.py", line 28, in <module>
import dns.resolver
ModuleNotFoundError: No module named 'dns'

Associated revisions

Revision 336 (diff)
Added by lmurphey about 5 years ago

Moving dns libs to bin directory for Python 3 support

Closes #2477

History

#1 Updated by Luke Murphey about 5 years ago

Observations:
  • from dns import resolver doesn't work either
  • from network_tools_app.dns import resolver does work
  • Copying dns to the main app directory makes it work
Solutions:
  • Add dns to sys.path
    • ['/Users/lmurphey/git/splunk-network-tools/src/bin', '/Users/lmurphey/Splunk/py3/lib/python3.7/site-packages/splunk/appserver/mrsparkle', '/Users/lmurphey/git/splunk-network-tools/src/bin', '/Users/lmurphey/Splunk/py3/lib/python37.zip', '/Users/lmurphey/Splunk/py3/lib/python3.7', '/Users/lmurphey/Splunk/py3/lib/python3.7/lib-dynload', '/Users/lmurphey/Splunk/py3/lib/python3.7/site-packages', '/Users/lmurphey/Splunk/py3/lib/python3.7/site-packages/bottle-0.12.17-py3.7.egg', '/Users/lmurphey/Splunk/py3/etc/apps/alert_logevent/bin', '/Users/lmurphey/Splunk/py3/etc/apps/alert_webhook/bin', '/Users/lmurphey/Splunk/py3/etc/apps/introspection_generator_addon/bin', '/Users/lmurphey/Splunk/py3/etc/apps/radius_auth/bin', '/Users/lmurphey/Splunk/py3/etc/apps/search/bin', '/Users/lmurphey/Splunk/py3/etc/apps/splunk_archiver/bin', '/Users/lmurphey/Splunk/py3/etc/apps/splunk_instrumentation/bin', '/Users/lmurphey/Splunk/py3/etc/apps/splunk_monitoring_console/bin', '/Users/lmurphey/Splunk/py3/etc/system/bin', '/Users/lmurphey/Splunk/py3/etc/apps/network_tools/bin/network_tools_app', '/Users/lmurphey/Splunk/py3/etc/apps/network_tools/bin/network_tools_app/dns', '/Users/lmurphey/Splunk/py3/etc/apps/network_tools/bin']
    • Still doesn't work

#2 Updated by Luke Murphey about 5 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF