Python Forum

Full Version: Pandas issue on Raspberry Pi
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a simple pandas import with a simple script on a raspberry pi. I can run it through the command line and through the editor. However, when I try to double click it to run it, it fails before doing anything. I see the screen flash and then it goes away without running the code.

import time
import pandas as pd
df = pd.read_csv('bar.csv')
print(df.tail())
time.sleep(60)
I ran this little test script because my larger script was having a similar issue so I tried to troubleshoot all of the possible issues. If I comment out all the pandas stuff it runs just fine when you double click it. What has me questioning my sanity is the fact that it does run just fine in the command line but not when I try to double click the file. The csv is in the same file location as the python file.
are you sure it's executed with the same python interpreter when you click on it vs. when run from command line?
try this to check:
import sys
import time
import pandas as pd
df = pd.read_csv('bar.csv')
print(df.tail())
input(sys.executable + '\nclcik any key...')
I am running the same interpreter on both. It still fails to launch.

I commetened out everything but the import pandas and the sleep. It still fails to load.
if you want an executable program you'll need pyinstaller other wise it's a basic text file with a suffix of py. when you double click it may bring up an default interpreter
but will not run your code.