Failed to install on Python 3.8.6 via virtualenv #34

Closed
opened 2020-11-10 16:13:34 +01:00 by sionsmith · 8 comments
sionsmith commented 2020-11-10 16:13:34 +01:00 (Migrated from github.com)

Hi,

I have seen this error been posted before. It seems to be a problem with the mac / virtualenv setup?

(chalice) ➜ aws-lambda-knockmail sudo pip3 install py3-validate-email
WARNING: The directory '/Users/sionsmith/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting py3-validate-email
Downloading py3-validate-email-0.2.10.tar.gz (12 kB)
Requirement already satisfied: dnspython~=2.0 in /Users/sionsmith/.virtualenvs/chalice/lib/python3.8/site-packages (from py3-validate-email) (2.0.0)
Requirement already satisfied: idna~=2.10 in /Users/sionsmith/.virtualenvs/chalice/lib/python3.8/site-packages (from py3-validate-email) (2.10)
Requirement already satisfied: filelock~=3.0 in /Users/sionsmith/.virtualenvs/chalice/lib/python3.8/site-packages (from py3-validate-email) (3.0.12)
Building wheels for collected packages: py3-validate-email
Building wheel for py3-validate-email (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/sionsmith/.virtualenvs/chalice/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-qbrsbjm8/py3-validate-email/setup.py'"'"'; file='"'"'/private/tmp/pip-install-qbrsbjm8/py3-validate-email/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-hm18gllz
cwd: /private/tmp/pip-install-qbrsbjm8/py3-validate-email/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/validate_email
copying validate_email/regex_check.py -> build/lib/validate_email
copying validate_email/mx_check.py -> build/lib/validate_email
copying validate_email/constants.py -> build/lib/validate_email
copying validate_email/init.py -> build/lib/validate_email
copying validate_email/updater.py -> build/lib/validate_email
copying validate_email/email_address.py -> build/lib/validate_email
copying validate_email/validate_email.py -> build/lib/validate_email
copying validate_email/domainlist_check.py -> build/lib/validate_email
copying validate_email/exceptions.py -> build/lib/validate_email
downloading blacklist to /private/tmp/pip-install-qbrsbjm8/py3-validate-email/build/lib/validate_email/data/blacklist.txt
error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124)>

Hi, I have seen this error been posted before. It seems to be a problem with the mac / virtualenv setup? (chalice) ➜ aws-lambda-knockmail sudo pip3 install py3-validate-email WARNING: The directory '/Users/sionsmith/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting py3-validate-email Downloading py3-validate-email-0.2.10.tar.gz (12 kB) Requirement already satisfied: dnspython~=2.0 in /Users/sionsmith/.virtualenvs/chalice/lib/python3.8/site-packages (from py3-validate-email) (2.0.0) Requirement already satisfied: idna~=2.10 in /Users/sionsmith/.virtualenvs/chalice/lib/python3.8/site-packages (from py3-validate-email) (2.10) Requirement already satisfied: filelock~=3.0 in /Users/sionsmith/.virtualenvs/chalice/lib/python3.8/site-packages (from py3-validate-email) (3.0.12) Building wheels for collected packages: py3-validate-email Building wheel for py3-validate-email (setup.py) ... error ERROR: Command errored out with exit status 1: command: /Users/sionsmith/.virtualenvs/chalice/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-qbrsbjm8/py3-validate-email/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-qbrsbjm8/py3-validate-email/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-hm18gllz cwd: /private/tmp/pip-install-qbrsbjm8/py3-validate-email/ Complete output (17 lines): running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/validate_email copying validate_email/regex_check.py -> build/lib/validate_email copying validate_email/mx_check.py -> build/lib/validate_email copying validate_email/constants.py -> build/lib/validate_email copying validate_email/__init__.py -> build/lib/validate_email copying validate_email/updater.py -> build/lib/validate_email copying validate_email/email_address.py -> build/lib/validate_email copying validate_email/validate_email.py -> build/lib/validate_email copying validate_email/domainlist_check.py -> build/lib/validate_email copying validate_email/exceptions.py -> build/lib/validate_email downloading blacklist to /private/tmp/pip-install-qbrsbjm8/py3-validate-email/build/lib/validate_email/data/blacklist.txt error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1124)>
karolyi commented 2020-11-10 16:19:12 +01:00 (Migrated from github.com)

Hey,

this seems to me that your python on your mac is unable to download the blacklist file because it's refusing to connect to github because of a certiface issue. Please check your certificates in python, and see if you can download the blacklist from within python.

If you can fix that part, you'll be able to install this package.

Also, why do you want to install this package as root when using virtualenv?

Hey, this seems to me that your python on your mac is unable to download the blacklist file because it's refusing to connect to github because of a certiface issue. Please check your certificates in python, and see if you can download the blacklist from within python. If you can fix that part, you'll be able to install this package. Also, why do you want to install this package as root when using virtualenv?
sionsmith commented 2020-11-10 16:21:59 +01:00 (Migrated from github.com)

Hi @karolyi

Thanks for getting back to me, so I was checking it was nothing todo with SSL access issues which is why I had sudo in there.

Let me investigate why I cannot download the blacklist

Hi @karolyi Thanks for getting back to me, so I was checking it was nothing todo with SSL access issues which is why I had sudo in there. Let me investigate why I cannot download the blacklist
karolyi commented 2020-11-10 16:24:07 +01:00 (Migrated from github.com)

Hey,

it's not an SSL issue per se, the libraries are there the way I see it. It's rather an older version of the root CA certificates you have? Just spitballing here, but I've seen these kind of errors happen when that was the issue.

Hey, it's not an SSL issue per se, the libraries are there the way I see it. It's rather an older version of the root CA certificates you have? Just spitballing here, but I've seen these kind of errors happen when that was the issue.
karolyi commented 2020-11-10 16:28:55 +01:00 (Migrated from github.com)

Also some advice: If you use virtualenv and have entered it, it's better to use python -m pip install py3-validate-email, as there were path issues when using pip3 as the main executable, especially under OSX.

Are you using the homebrew python?

Also some advice: If you use virtualenv and have entered it, it's better to use `python -m pip install py3-validate-email`, as there were path issues when using `pip3` as the main executable, especially under OSX. Are you using the homebrew python?
sionsmith commented 2020-11-10 16:56:00 +01:00 (Migrated from github.com)

Ok so I have finally managed to get this working by updated my cacert.pem bundle.

However
I have deployed this to lambda and I am continuously getting false returned. When I run this locally I get true. Are you aware of any other libraries I have to include? I get the following messages running in debug:


5609df49-597f-4c39-8f67-08beae01d2ab	Validation for 'sion@osodevops.io' failed: Email address undeliverable:aspmx.l.google.com.: [Errno 97] Address family not supported by protocolaspmx2.googlemail.com.: [Errno 97] Address family not supported by protocolaspmx3.googlemail.com.: [Errno 97] 
Address family not supported by protocolalt1.aspmx.l.google.com.: [Errno 97] 
Address family not supported by protocolalt2.aspmx.l.google.com.: [Errno 97] 
Address family not supported by protocol | 

[WARNING] 2020-11-10T15:54:42.721Z 5609df49-597f-4c39-8f67-08beae01d2ab Validation for 'sion@osodevops.io' failed: Email address undeliverable: aspmx.l.google.com.: [Errno 97] 
Address family not supported by protocol aspmx2.googlemail.com.: [Errno 97] 
Address family not supported by protocol aspmx3.googlemail.com.: [Errno 97] 
Address family not supported by protocol alt1.aspmx.l.google.com.: [Errno 97] 
Address family not supported by protocol alt2.aspmx.l.google.com.: [Errno 97] 
Address family not supported by protocol
-- | --



Ok so I have finally managed to get this working by updated my cacert.pem bundle. **However** I have deployed this to lambda and I am continuously getting false returned. When I run this locally I get true. Are you aware of any other libraries I have to include? I get the following messages running in debug: ``` 5609df49-597f-4c39-8f67-08beae01d2ab Validation for 'sion@osodevops.io' failed: Email address undeliverable:aspmx.l.google.com.: [Errno 97] Address family not supported by protocolaspmx2.googlemail.com.: [Errno 97] Address family not supported by protocolaspmx3.googlemail.com.: [Errno 97] Address family not supported by protocolalt1.aspmx.l.google.com.: [Errno 97] Address family not supported by protocolalt2.aspmx.l.google.com.: [Errno 97] Address family not supported by protocol | [WARNING] 2020-11-10T15:54:42.721Z 5609df49-597f-4c39-8f67-08beae01d2ab Validation for 'sion@osodevops.io' failed: Email address undeliverable: aspmx.l.google.com.: [Errno 97] Address family not supported by protocol aspmx2.googlemail.com.: [Errno 97] Address family not supported by protocol aspmx3.googlemail.com.: [Errno 97] Address family not supported by protocol alt1.aspmx.l.google.com.: [Errno 97] Address family not supported by protocol alt2.aspmx.l.google.com.: [Errno 97] Address family not supported by protocol -- | -- ```
karolyi commented 2020-11-10 17:02:39 +01:00 (Migrated from github.com)

There can be multiple reasons for this, most likely you don't have an interface with an IPv4 or IPv6 address, depending on which the module resolves first. Normally there should be a fallback to IPv4 when IPv6 is unreachable so I would assume you don't have an IPv4 interface within your lambda.

Also, you might want to check #26.

There can be multiple reasons for this, most likely you don't have an interface with an IPv4 or IPv6 address, depending on which the module resolves first. Normally there should be a fallback to IPv4 when IPv6 is unreachable so I would assume you don't have an IPv4 interface within your lambda. Also, you might want to check #26.
sionsmith commented 2020-11-10 18:13:26 +01:00 (Migrated from github.com)

So FYI port 25 is blocked now on Lambda so all the of the stmp connections for validations will not work: https://aws.amazon.com/lambda/faqs/#functions

I also attempted to use a couple of other ports but no luck - they must of actually blocked the protocol.

So FYI port 25 is blocked now on Lambda so all the of the stmp connections for validations will not work: https://aws.amazon.com/lambda/faqs/#functions I also attempted to use a couple of other ports but no luck - they must of actually blocked the protocol.
karolyi commented 2020-11-10 18:16:33 +01:00 (Migrated from github.com)

Yes, this is what I was referring to with #26.

If you don't have further issues, please close this issue, or wait 2 weeks until it gets closed by being stale.

Yes, this is what I was referring to with #26. If you don't have further issues, please close this issue, or wait 2 weeks until it gets closed by being stale.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: karolyi/py3-validate-email#34
No description provided.