Forums

ftp errors

Hi All, I am new on PythonAnywhere. I have error when try to connecting to "ftpserver.acanac.com".

Can some one figure out what is my problem? I have no problem on my Linux Terminal. Thank you. Vilounha Here is my code:

from ftplib import FTP
ftp = FTP('ftpserver.acanac.com')
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/ftplib.py", line 117, in init self.connect(host) File "/usr/lib/python2.7/ftplib.py", line 132, in connect self.sock = socket.create_connection((self.host, self.port), self.timeout) File "/usr/lib/python2.7/socket.py", line 571, in create_connection raise err socket.error: [Errno 111] Connection refused

Are you using a free account? Free accounts can only access a small set of web sites chosen by PythonAnywhere.

Yup, jgmdavies has it right -- free accounts can only access sites on the whitelist, and also can only use HTTP/HTTPS. So that will fail for both of those reasons.

@efaleb -- if you have a resource that you can access by HTTP rather than FTP, and it's on a site with a public API, then we will be happy to add that to the whitelist so that you can get your code working.