I upgraded to 3.6 python and now I can't run my script that runs fine in 2.7, I am not sure why, any ideas?
current code
import arcpy
import os
import os.path
from ftplib import FTP
directory = "\\maps" #location of folder on ftp
copy_files = "*.pdf" # This is the files i would like to copy from the ftp site
folder = "D:\\temp\\temp\\"
out_path = os.path.join(folder)
#FTP logon
ftp = FTP("ftp.proper.com")
ftp.login('blahuser', 'blahpass')
# navigate folder
ftp.cwd(os.path.join(directory))
print ("Changed to " + os.path.join(directory, copy_files))
#Now get a list of all files in the folder
filenames = ftp.nlst()
print (filenames)
#and loop through the filenames to download the files to your local 'folder'
for f in filenames:
with open(os.path.join(out_path, f), 'wb') as local_file:
ftp.retrbinary('RETR '+ f, local_file.write)
ftp.close()
print ("closed ftp connection")
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Error
Traceback (most recent call last):
File "C:/Python Scripts/FPT/TransferFromFtp.py", line 15, in <module>
ftp.login('blahuser', 'blahpass')
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\ftplib.py", line 420, in login
resp = self.sendcmd('PASS ' + passwd)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\ftplib.py", line 273, in sendcmd
return self.getresp()
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\ftplib.py", line 246, in getresp
raise error_perm(resp)
ftplib.error_perm: 530 Not logged in.<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>