domainaware / checkdmarc

A parser for SPF and DMARC DNS records
https://domainaware.github.io/checkdmarc
Apache License 2.0
245 stars 76 forks source link

ModuleNotFound error with basic installation. #82

Closed rahearn closed 1 year ago

rahearn commented 1 year ago

I am consistently running into the following error when trying to use checkdmarc.

Environment:

Official python docker image with no customizations.

└─> docker run -it --rm python bash
root@baba3ff4b235:/# pip3 install checkdmarc
Collecting checkdmarc
  Downloading checkdmarc-4.4.4-py2.py3-none-any.whl (24 kB)
Collecting expiringdict>=1.1.4
  Downloading expiringdict-1.2.2-py3-none-any.whl (8.5 kB)
Collecting pyleri>=1.3.2
  Downloading pyleri-1.4.1.tar.gz (34 kB)
  Preparing metadata (setup.py) ... done
Collecting dnspython>=2.0.0
  Downloading dnspython-2.2.1-py3-none-any.whl (269 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 269.1/269.1 kB 6.8 MB/s eta 0:00:00
Collecting publicsuffix2>=2.20191221
  Downloading publicsuffix2-2.20191221-py2.py3-none-any.whl (89 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.0/89.0 kB 18.1 MB/s eta 0:00:00
Collecting timeout-decorator>=0.4.1
  Downloading timeout-decorator-0.5.0.tar.gz (4.8 kB)
  Preparing metadata (setup.py) ... done
Collecting requests>=2.25.0
  Downloading requests-2.28.1-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 11.3 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
  Downloading certifi-2022.9.24-py3-none-any.whl (161 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.1/161.1 kB 30.2 MB/s eta 0:00:00
Collecting charset-normalizer<3,>=2
  Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 7.9 MB/s eta 0:00:00
Collecting urllib3<1.27,>=1.21.1
  Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 11.5 MB/s eta 0:00:00
Building wheels for collected packages: pyleri, timeout-decorator
  Building wheel for pyleri (setup.py) ... done
  Created wheel for pyleri: filename=pyleri-1.4.1-py3-none-any.whl size=31733 sha256=9a5fda723ba620f8dedb2942028112e01236f6b686e1f99ab26ffc3e93015521
  Stored in directory: /root/.cache/pip/wheels/83/01/ce/1f167ca802b79bf77efde6ca38c3044288f33a94f832595a3f
  Building wheel for timeout-decorator (setup.py) ... done
  Created wheel for timeout-decorator: filename=timeout_decorator-0.5.0-py3-none-any.whl size=5006 sha256=b1efb9ac939992ae6b9af3afc5503c80fee7313bb56ef11b97b0ca9b605edada
  Stored in directory: /root/.cache/pip/wheels/68/2f/bc/76f1192d474666d41ae6f09813fccbd00fe3f07e8261c4cff5
Successfully built pyleri timeout-decorator
Installing collected packages: timeout-decorator, pyleri, publicsuffix2, expiringdict, urllib3, idna, dnspython, charset-normalizer, certifi, requests, checkdmarc
Successfully installed certifi-2022.9.24 charset-normalizer-2.1.1 checkdmarc-4.4.4 dnspython-2.2.1 expiringdict-1.2.2 idna-3.4 publicsuffix2-2.20191221 pyleri-1.4.1 requests-2.28.1 timeout-decorator-0.5.0 urllib3-1.26.12
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

root@baba3ff4b235:/# checkdmarc --help
Traceback (most recent call last):
  File "/usr/local/bin/checkdmarc", line 5, in <module>
    from checkdmarc.py import _main
ModuleNotFoundError: No module named 'checkdmarc.py'; 'checkdmarc' is not a package
rahearn commented 1 year ago

4.4.2 works, so I think https://github.com/domainaware/checkdmarc/commit/ca0d3b3a253957f56e5b67aa8b7075c150422e71#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711L40 is likely the problem.

seanthegeek commented 1 year ago