Skip to content

Instantly share code, notes, and snippets.

@tpgmartin
Created December 19, 2019 11:42
Show Gist options
  • Save tpgmartin/b6e8afe0af8e475162f8dd69f176c0e3 to your computer and use it in GitHub Desktop.
Save tpgmartin/b6e8afe0af8e475162f8dd69f176c0e3 to your computer and use it in GitHub Desktop.
Disable SSL to install nltk dependencies
import nltk
import ssl
def download_dependencies(package_name=None):
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
pass
else:
ssl._create_default_https_context = _create_unverified_https_context
nltk.download(package_name) if package_name else nltk.download()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment