Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The dns related modules fails to load on OSX: cannot import name 'Opcode' #81

Open
nresare opened this issue Mar 20, 2018 · 2 comments
Open

Comments

@nresare
Copy link
Contributor

nresare commented Mar 20, 2018

Version information

head from github, 6740c10

Steps to replicate

  1. You need an OSX machine with a default case insensitive filesystem (something you get if you install a recent version without any special partitioning options)
  2. Install a recent python (I use python3 from brew) and virtualenv.
  3. Install the default deps from python3.txt and tests.txt with pip install -r
  4. Run py.test tests/unit/test_plugins/test_dns_eval.py

Actual result

==================================== ERRORS ====================================
__________ ERROR collecting tests/unit/test_plugins/test_dns_eval.py ___________
tests/unit/test_plugins/test_dns_eval.py:3: in <module>
    import oa.dns_interface
oa/dns_interface.py:9: in <module>
    import dns
../../.virtualenvs/oa-2.7/lib/python3.6/site-packages/dns/__init__.py:24: in <module>
    from . import Opcode
E   ImportError: cannot import name 'Opcode'

Expected result

Test success

Other notes

The reason for this is that py3dns and dnspython, being installed in modules dns and DNS respectively end up in the same directory because of the case insensitive nature of the OSX filesystem and end up clobbering each other.

Since dnspython seems like the more widely used and feature complete library I think that the non-hacky way forward here is to convince pyspf upstream to release a version that uses dnspython instead of py3dns and work around the problem. Fortunately it seems like the individual that uploaded the latest version of pyspf has some stale code in his github repo that makes pyspf dns library agnostic.

@jayvdb
Copy link

jayvdb commented Jan 25, 2020

nresare/dnsplug#2 could be the solution, that you already prepared earlier .. ;-)

@jayvdb
Copy link

jayvdb commented Jan 25, 2020

rthalley/dnspython#303 for some responses from the maintainers about the conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants