While downloading NLTK stopwords , I am getting the following error
[nltk_data] Error loading stopwords: <urlopen error [Errno 110]
[nltk_data] Connection timed out>
The code used is
import nltk
nltk.download('stopwords')
I also tried the following command and got the same error
python -m nltk.downloader stopwords
Thanks
Related
I'm running Django 3.2 with django-tenants on a Windows local dev environment.
In my windows hosts file I have:
127.0.0.1 *.localhost
...so that I am able to use subdomains with django-tenants. E.g. http://mysub.localhost:8000.
When running ./manage.py runserver the dev server runs perfectly. However, when trying to execute urlopen in my code I get an error:
>>> html = urlopen('http://mysub.localhost:8000')
Traceback (most recent call last):
[...]
urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>
As far as I can tell the error is due to the proxy settings on my windows machine (this does not fail in production), but I am unsure how to resolve it?
While deploying this repo on heroku I'm getting error as I mentioned below:
app[worker.1]: OSError: [Errno 36] File name too long: 'filename'
May be getting error because of outdated version of pyrogram ?
OS: Windows 10
tensorflow and keras succesfully imported, python 3.7.9
tf.__version__
>>> '2.1.0'
keras.__version__
>>> '2.2.4-tf'
Problem
Tried load_datasets or any dataset available in tf.keras such as:
(train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.fashion_mnist.load_data()
give this error
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
.
.
.
URLError: <urlopen error [WinError 10054] An existing connection was forcibly closed by the remote host>
During handling of the above exception, another exception occurred:
.
.
.
Exception: URL fetch failure on https://storage.googleapis.com/tensorflow/tf-keras-datasets/train-labels-
idx1-ubyte.gz: None -- [WinError 10054] An existing connection was forcibly closed by the remote host
The three dots showing bunch of code lines that can't be executed.
Anyone knows how to solve? I've been looking for possible solutions but the closest I can find is solving certification/verification issue, I think mine is about URL.
I know the workaround is to download the dataset from kaggle etc., but I want to know what cause this. Thanks guys
EDIT: it's not URL problem, unable to access https://storage.googleapis.com using IDM, but files can be downloaded directly in browser. So I guess it's security issue
Finally after 5 hours reading here and there..
Please check the solution by CRLannister here https://github.com/tensorflow/tensorflow/issues/33285
What it doesn't mention is where data_utils.py is located in case of Windows OS and anaconda environment. It's located here
~\Anaconda3\envs\*your_env*\Lib\site-packages\tensorflow_core\python\keras\utils\data_utils.py
just add the following after all the import statement
import requests
requests.packages.urllib3.disable_warnings()
import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
# Legacy Python that doesn't verify HTTPS certificates by default
pass
else:
# Handle target environment that doesn't support HTTPS verification
ssl._create_default_https_context = _create_unverified_https_context
I have a problem with this code, please help me solve it this code
is giving give me the following error:
socket.gaierror: [Errno 11001] getaddrinfo failed
import socket
servername='host'
serverport=12000
clientsocket=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
message=input('input:')
clientsocket.sendto(message.encode('ascii'),(servername,serverport))
modimess,serveraddress=clientsocket.recvfrom(2048)
print(modimess)
clientsocket.close()
I am trying to link to a Oracle Database using cx_Oracle in python and keep getting the error:
DatabaseError: ORA-12170: TNS:Connect timeout occurred
Here is the code I am running:
import cx_Oracle
dsn_tns = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*ip*)(PORT=*port*))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=*service_name*)))'
db= cx_Oracle.connect('*username*', '*password*', dsn_tns, encoding="UTF-8")