Closed venturaEffect closed 5 years ago
Can it be maybe because there is more than two words for name? Like Albert Gustav Bramsteidl?
Just a suggestion...
Hi @venturaEffect,
In the case of 3 names it sets last_name to 'Gustav Bramsteidl'. The error here might be that your target only has a 1 word name, so the whole thing is 'Gustav'. Does that line up with your input?
Hi @Greenwolf ,
I've looked on the spreadsheet and there are always minimum two words on name.
Hi @venturaEffect, I would suggest adding a this print statement to the line before the one it crashed on, as its part of a loop. Then when you run it you can see which name caused the crash and we can get to the bottom of this?
So replace line 918: last_name = full_name.split(" ",1)[1]
With this: print(full_name) last_name = full_name.split(" ",1)[1]
Hi @Greenwolf , it prints all of them the 800 names from the list.
Wrote the line of code on social_mapper.py how you told me.
Traceback (most recent call last):
File "social_mapper.py", line 919, in <module>
last_name = full_name.split(" ",1)[1]
IndexError: list index out of range
After the whole list it ends with this line.
Sorry TRUE!
There was one name with just one word! The last one....
Ok, but what name is printed just before the error?
~/social_mapper$ python social_mapper.py -f csv -i SNOWPLAN.1.csv -m accurate -ig -tw -t strict
After printing all the main list what seems ok I get this error:
Traceback (most recent call last):
File "social_mapper.py", line 916, in <module>
urllib.urlretrieve(person_image, "temp-targets/" + full_name + ".jpg")
File "/usr/lib/python2.7/urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
File "/usr/lib/python2.7/urllib.py", line 245, in retrieve
fp = self.open(url, data)
File "/usr/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 469, in open_file
return self.open_local_file(url)
File "/usr/lib/python2.7/urllib.py", line 483, in open_local_file
raise IOError(e.errno, e.strerror, e.filename)
IOError: [Errno 2] No such file or directory: ''
I mean, it seems all ok... the sintaxis, the names, the columns whithout header, the img urls,...
Why could it be? Really appreciate your time @Greenwolf
Ok, but what name is printed just before the error?
Yes. All the list is print. Maybe that is because the one that is just one word is the last name of the list.
I just added a fix for this, so if theres only one name it will set the lastname to an empty string. Hope this sorts it out for you!
Hi!
Is this a kind of error because of names too long? or why could that be?
Thank you friends.