Python Forum
Pandas issue on Raspberry Pi
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandas issue on Raspberry Pi
#1
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.
Reply
#2
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...')
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
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.
Reply
#4
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Issue in getting the required data from nested json and store it in a pandas datafram PrateekG 2 3,278 May-20-2018, 11:25 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020