Export application problem especially when include csv library in processing.py

Hello everyone, I have a problem when trying to export the program especially if it contains CSV library in Processing.py.

If I don’t tick the option for “Embed Java for Windows (64-bit)”, it successful to be exported. But, when I try to run the application, it opens for a short moment, then it is closed automatically. I don’t face such kind of this problem when I don’t include the CSV library.

If I tick the option for “Embed Java for Windows (64-bit)”, it gives error statement: ‘Export to windows64 failed’. This problem happens to any kind of file I want to export.

I guess there is something with this CSV library. Though it is also something wrong in my setup because I still failed to embed Java for any program.

I already put the folder of processing to C:\ directory, as I found in some discussion it might be one of the cause.

I use windows 10 64bit, Processing 3.5.3, with Java 8 installed.

Here is the program that I tried to export:

import csv
fileName = 'csv_data.csv'

with open(fileName, 'rt') as csv_file:
    csv_reader = csv.reader(csv_file)
    line_count = 0
    for row in csv_reader:
        if line_count == 0:
            text('Column names are ' +(", ".join(row)),10,30)
            line_count += 1
            text('Data for ' + row[0] + ' is ' + row[1],10,(line_count+1)*30)
            line_count += 1 

And this is the sample of the CSV file:

2016/07/04 0:00,50
2016/07/04 1:00,70
2016/07/04 2:00,40
2016/07/04 3:00,65
2016/07/04 4:00,43
2016/07/04 5:00,32

Hope someone can help :pray:t2:

1 Like

Have you tried copying the CSV file to the application.windows32 sub-folder within the sketch folder?

Despite the ‘Export to windows64 failed’, the .exe within the application.windows32 folder should run fine.

Hi, I tried your suggestion,

then it works very fine. Thanks :slight_smile:

However, by using this way, it will be very messy if I have so many CSV files. :thinking:
It should be some way to define the directory where the files are stored.

1 Like

Sure – you can use a folder named “data”.

1 Like

Sorry, I forgot to mention that when the application close automatically (my first problem), all CSV data are stored in the folder named “data” which is automatically created when I exported the application.

So, I still confused about how to handle this. Because when I put the CSV data together in the same directory with the *.exe file (as you suggested), it is no problem. :crying_cat_face: