ConnectionRefusedError in Anaconda3 Win10

Hi,

i’m a beginner at jupyter. so for university we should do labatories in jupyter notebook. and i tried to execute the first line and it told me: “ConnectionRefusedError” “URLError: <urlopen error [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte>” which translates in couldn’t establish a connection, because the other computer denied the connection. I’m using anaconda3 on windows10. the code was the following:

# iPython magic command to load the matplotlib library and
# select the notebook graphics frontend
%matplotlib inline
# import necessary functions from the thkdss library
from thkdsp import *
from dsplab import *
# import audio related functions from the audio submodule
from thkdsp.audio import play_signal, wav2dtsignal
# import some definitions and functions from numpy, the python library for Matlab-like array processing
from numpy import arange, shape, array, zeros, size, ones, isscalar

the folder “thkdsp” and “dsplab” are in the same folder as the file. i tried executing as admin but it doesnt help.

"ConnectionRefusedError Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\urllib\request.py in do_open(self, http_class, req, **http_conn_args)
1353 try:
→ 1354 h.request(req.get_method(), req.selector, req.data, headers,
1355 encode_chunked=req.has_header(‘Transfer-encoding’))

C:\ProgramData\Anaconda3\lib\http\client.py in request(self, method, url, body, headers, encode_chunked)
1254 “”“Send a complete request to the server.”""
→ 1255 self._send_request(method, url, body, headers, encode_chunked)
1256 "

and so on…

thanks for the help!!

Did you mean you tried to execute the first cell?

The first line of your code that you show is commented out and so that shouldn’t cause an issue.

First code line you show is %matplotlib inline and I don’t see how that relates the error you show.

If you run, the following, does it give an error:

print("test")

If that works, can you run each of your lines and then say which actual line gives the error you are listing above?

The reasons I’m asking is that, more than likely this isn’t a Jupyter issue. Meaning if you ran this as Python code separate from Jupyter, you’d still have the same problem. However, since you are new at Jupyter you may not be able to sort what is a Jupyter issue from a Python issue.

great. thanks for the idea. it was all one execution.

now i put it in different cells.

this only creates a problem:
from thkdsp.audio import play_signal, wav2dtsignal

You may also be able to break that down further by running the following lines independently:

from thkdsp.audio import wav2dtsignal
from thkdsp.audio import play_signal

One may be the source of your error and not the other?


How did you install thkdsp? (Nevermind: I think in post you say just in same folder and so maybe not installed.*)
I see dsplab at the Python Package Index (PyPi), specifically here.
But I was unable to find a source of thkdsp (or ‘the thkdss library’ [sic]) anywhere. Or anything about ‘wav2dtsignal’.

*You say in your post they are in the same folder which suggests they are not readily available as open source and that will limit the ability of others to help you. This looks like a Python problem, but unless others have the code, they cannot help you. You should contact the person assigning this to you to do.

1 Like