classification
Title: Unable to run scripts: idle3 -r script.py
Type: Stage: resolved
Components: IDLE Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: davidjackson1955, zach.ware
Priority: normal Keywords:

Created on 2016-01-09 02:44 by davidjackson1955, last changed 2016-01-09 03:46 by zach.ware. This issue is now closed.

Messages (3)
msg257792 - (view) Author: David Jackson (davidjackson1955) Date: 2016-01-09 02:44
[Raspberry Jessie] Idle3(4.2]
If I open a idle3 shell (from menu) and enter >>import pandas as pd it accepts the command, but if I trying and run it from the shell>> idle3 -r script.py I get the following errors:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import pandas as pd
  File "/home/pi/python/pandas.py", line 3, in <module>
    from pandas_datareader import data, wb
  File "/usr/local/lib/python3.4/dist-packages/pandas_datareader-0.2.1-py3.4.egg/pandas_datareader/__init__.py", line 3, in <module>
    from .data import (get_components_yahoo, get_data_famafrench, get_data_google, get_data_yahoo,
  File "/usr/local/lib/python3.4/dist-packages/pandas_datareader-0.2.1-py3.4.egg/pandas_datareader/data.py", line 7, in <module>
    from pandas_datareader.google.daily import GoogleDailyReader
  File "/usr/local/lib/python3.4/dist-packages/pandas_datareader-0.2.1-py3.4.egg/pandas_datareader/google/daily.py", line 1, in <module>
    from pandas_datareader.base import _DailyBaseReader
  File "/usr/local/lib/python3.4/dist-packages/pandas_datareader-0.2.1-py3.4.egg/pandas_datareader/base.py", line 9, in <module>
    from pandas import to_datetime
ImportError: cannot import name 'to_datetime'
msg257793 - (view) Author: David Jackson (davidjackson1955) Date: 2016-01-09 03:07
The problem was I had a pandas.py and a pandas.pyc in my home directory. after deleting them everything seems to be working.
msg257794 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-01-09 03:46
Glad you got it figured out.  It's a situation that can be tricky to debug, as your eyes tend to gloss over the paths given in the traceback.  It's much easier to figure out after you've been bitten the first time, though!
History
Date User Action Args
2016-01-09 03:46:29zach.waresetstatus: open -> closed

nosy: + zach.ware
messages: + msg257794

stage: resolved
2016-01-09 03:07:10davidjackson1955setresolution: not a bug
messages: + msg257793
2016-01-09 02:44:40davidjackson1955create