url = 'ftp://ftp.ensemblgenomes.org/pub/release-41/bacteria//fasta/bacteria_176_collection/_bacillus_aminovorans/cdna/'
ftp = ftplib.FTP(url)
From the documentation of ftplib:
class ftplib.FTP(host='', user='', passwd='', acct='', timeout=None, source_address=None)
Return a new instance of the FTP class. When host is given, the method call connect(host) is made.
In other words: the first argument is expected to be a hostname only, not a URL with protocol://host/path
. If you want to connect to the server and make the server change to a specific path you need to do this in steps instead:
ftp = ftplib.FTP('ftp.ensemblgenomes.org','ftp','user@example.com')
ftp.cwd('/pub/release-41/bacteria//fasta/bacteria_176_collection/_bacillus_aminovorans/cdna/')