Formatting inventory of parts
Can you store the content in the CSV file in the memory?It will be more effective to read from the memory than the disk. 

Maybe the CSV file will also be store in the memory cache by OS, but you can do it your self to make it more reliable.

Of course it's only when there is enough memory you can do this.

OK, from your code, I think maybe you just need to read all line[1] in and then scan it.

partNOs=[line.split("\t")[1] for line in upload]
for partNO in partNOs:
    if partNO in similar and similar[partNO] in partNOs:
        upload.write("blabla")


This assume that: what you write to file 'upload' will not match similar keys and values. Because it read the file and use the 'cache' before write into it.