No module named 'dns' #41
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: karolyi/py3-validate-email#41
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I get a strange error message when applying your test code:
System: Windows 10 with Python 3.9
Log:
c:/Python39/Scripts/test.py
Traceback (most recent call last):
File "c:\Python39\Scripts\test.py", line 2, in
from validate_email import validate_email
File "C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\validate_email_init_.py", line 1, in
from .validate_email import validate_email, validate_email_or_fail # NOQA
File "C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\validate_email\validate_email.py", line 8, in
from .mx_check import mx_check
File "C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\validate_email\mx_check.py", line 7, in
from dns.exception import Timeout
ModuleNotFoundError: No module named 'dns'
this indicates that the
dnspython
module (specified as a requirement insetup.py
) is not installed. did you enter your virtual environment that you installed this module into, before testing?dnspython is installed.
Traceback (most recent call last):
File "c:\Python39\Scripts\test.py", line 2, in
from validate_email import validate_email
File
"C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\validate_email_init_.py",
line 1, in
from .validate_email import validate_email, validate_email_or_fail #
NOQA
File
"C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\validate_email\validate_email.py",
line 8, in
from .mx_check import mx_check
File
"C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\validate_email\mx_check.py",
line 7, in
from dns.exception import Timeout
ModuleNotFoundError: No module named 'dns'
PS C:\Python39\Scripts> pip3 install dnspython
Requirement already satisfied: dnspython in
c:\users\marti\appdata\local\programs\python\python39\lib\site-packages
(2.0.0)
Best
Martin
what's the output of
python -m pip freeze
?PS C:\Python39\Scripts> python -m pip freeze
astroid==2.4.2
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
colorama==0.4.4
dnspython==2.0.0
fastapi==0.62.0
filelock==3.0.12
fpdf==1.7.2
h11==0.11.0
idna==2.10
isort==5.6.4
lazy-object-proxy==1.4.3
mccabe==0.6.1
paho-mqtt==1.5.1
pathlib==1.0.1
Pillow==8.0.1
py3-validate-email==0.2.12
pydantic==1.7.3
pylint==2.6.0
python-dotenv==0.15.0
pywin32==300
PyYAML==5.3.1
reportlab==3.5.56
requests==2.25.1
six==1.15.0
starlette==0.13.6
toml==0.10.2
urllib3==1.26.2
uvicorn==0.13.1
validate-email==1.3
watchgod==0.6
websockets==8.1
wrapt==1.12.1
Am Mi., 6. Jan. 2021 um 20:44 Uhr schrieb László Károlyi <
notifications@github.com>:
that's odd.
are you sure the script you run uses the same python and the same virtual environment?
Yes. There is no venv.
[image: image.png]
Am Mi., 6. Jan. 2021 um 21:11 Uhr schrieb László Károlyi <
notifications@github.com>:
what is the output of
python -c 'import dns; print(dns.__file__)'
?PS C:\Python39\Scripts> python -c 'import dns; print(dns.file)'?
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'dns'
PS C:\Python39\Scripts>
Am Mi., 6. Jan. 2021 um 21:20 Uhr schrieb László Károlyi <
notifications@github.com>:
can you paste the output of
dir C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\
?Verzeichnis von
C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages
06.01.2021 20:49
.06.01.2021 20:49 ..
18.12.2020 20:42 adodbapi
18.12.2020 20:43 certifi
18.12.2020 20:43 certifi-2020.12.5.dist-info
18.12.2020 20:43 chardet
18.12.2020 20:43 chardet-4.0.0.dist-info
20.12.2020 02:47 click
20.12.2020 02:47 click-7.1.2.dist-info
06.01.2021 20:49 DNS
06.01.2021 01:57 dnspython-2.0.0.dist-info
20.12.2020 20:21 dotenv
18.12.2020 20:11 126 easy_install.py
20.12.2020 20:21 fastapi
20.12.2020 20:21 fastapi-0.62.0.dist-info
06.01.2021 01:57 filelock-3.0.12.dist-info
06.01.2021 01:57 13.229 filelock.py
19.12.2020 20:28 fpdf
19.12.2020 20:28 fpdf-1.7.2-py3.9.egg-info
20.12.2020 02:47 h11
20.12.2020 02:47 h11-0.11.0.dist-info
18.12.2020 20:43 idna
18.12.2020 20:43 idna-2.10.dist-info
18.12.2020 20:42 isapi
02.01.2021 12:49 paho
02.01.2021 12:49 paho_mqtt-1.5.1-py3.9.egg-info
18.12.2020 20:43 pathlib-1.0.1-py3.9.egg-info
03.09.2014 16:25 41.481 pathlib.py
19.12.2020 20:08 PIL
19.12.2020 20:08 Pillow-8.0.1.dist-info
18.12.2020 20:42 pip
18.12.2020 20:42 pip-20.3.3.dist-info
18.12.2020 20:11 pkg_resources
06.01.2021 01:57 py3_validate_email-0.2.12-py3.9.egg-info
20.12.2020 20:21 pydantic
20.12.2020 20:21 pydantic-1.7.3.dist-info
18.12.2020 20:42 138 pythoncom.py
18.12.2020 20:42 pythonwin
20.12.2020 20:21 python_dotenv-0.15.0.dist-info
18.12.2020 20:42 pywin32-300.dist-info
18.12.2020 20:42 2.666.406 PyWin32.chm
18.12.2020 20:42 178 pywin32.pth
18.12.2020 20:42 5 pywin32.version.txt
18.12.2020 20:42 pywin32_system32
20.12.2020 20:21 PyYAML-5.3.1.dist-info
07.12.2020 18:12 121 README.txt
19.12.2020 20:08 reportlab
19.12.2020 20:08 reportlab-3.5.56.dist-info
18.12.2020 20:43 requests
18.12.2020 20:43 requests-2.25.1.dist-info
18.12.2020 20:11 setuptools
18.12.2020 20:11 setuptools-49.2.1.dist-info
20.12.2020 20:21 starlette
20.12.2020 20:21 starlette-0.13.6.dist-info
18.12.2020 20:43 urllib3
18.12.2020 20:43 urllib3-1.26.2.dist-info
20.12.2020 02:47 uvicorn
20.12.2020 02:47 uvicorn-0.13.1.dist-info
06.01.2021 01:57 validate_email
06.01.2021 01:18 validate_email-1.3-py3.9.egg-info
23.03.2015 05:22 8.340 validate_email.py
20.12.2020 20:20 watchgod
20.12.2020 20:21 watchgod-0.6.dist-info
20.12.2020 20:20 websockets
20.12.2020 20:20 websockets-8.1-py3.9.egg-info
18.12.2020 20:42 win32
18.12.2020 20:42 win32com
18.12.2020 20:42 win32comext
20.12.2020 20:21 yaml
20.12.2020 20:21 259.584 _yaml.cp39-win_amd64.pyd
06.01.2021 01:57 pycache
10 Datei(en), 2.989.608 Bytes
61 Verzeichnis(se), 155.285.016.576 Bytes frei
Am Mi., 6. Jan. 2021 um 21:56 Uhr schrieb László Károlyi <
notifications@github.com>:
so for some weird reason, the
dns
module thatdnspython
installs, is installed most probably into thatDNS
directory (uppercase name), and so the module can't import it with lowercase name.what's the content of
C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\dnspython-2.0.0.dist-info\top_level.txt
,C:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\dnspython-2.0.0.dist-info\RECORD
andC:\Users\marti\AppData\Local\Programs\Python\Python39\lib\site-packages\dnspython-2.0.0.dist-info\METADATA
?you could also try reinstalling the module into a new environment.
OK, thank you, Lázló!
If you say, the problem has nothing to do with your module, I am going to
reinstall the environment.
Thanks again for your help!
Best
Martin
Am Mi., 6. Jan. 2021 um 22:10 Uhr schrieb László Károlyi <
notifications@github.com>:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.