I wrote some code to import the DataReader function in pandas.io.data
from pandas.io.data import DataReader
Unfortunately, PyCharm is unable to resolve 'data'. I get the following
error:
Traceback (most recent call last):
File "/Users/MyName/PycharmProjects/test/mytest", line 3, in <module>
from pandas.io.data import DataReader
ImportError: No module named data
What is puzzling is that PyCharm can resolve pandas.stats.moments but
can't resolve pandas.io.data. I checked that both directories have the
__init__.py file (the files are blank).
Based on ThomasK (from stackoverflow) recommendation I checked to see
what version of pandas PyCharm was loading. It appears its still loading
v 0.3.0 despite the fact that I wiped this version out prior to
installing pandas 0.6.0.
I did some digging and realized that the __egginst__.txt file had
references to the old version:
$ cat __egginst__.txt
# egginst metadata
egg_name = 'pandas-0.3.0-3.egg'
prefix = '/Library/Frameworks/EPD64.framework/Versions/7.1'
installed_size = 1454562
rel_files = [
'EGG-INFO/pandas/__egginst__.txt',
'lib/python2.7/site-packages/pandas-0.3.0-3.egg-info',
At this point I'm wondering whether the pandas 0.6.0 install from source
on MacOS would update this file? Is PyCharm using the __egginst__.txt
file? Is the solution as simple as editing this file and making the
appropriate changes or is there something more involved?
Appreciate the feedback.
Kind Regards,
Sp
/Library/Frameworks/EPD64.framework/Versions/7.1/EGG-INFO/pandas/spec
also has reference to the old pandas version.
$ cat depend
metadata_version = '1.1'
name = 'pandas'
version = '0.3.0'
build = 3
arch = 'amd64'
platform = 'darwin'
osdist = None
python = '2.7'
packages = [
'numpy 1.6.1',
'python_dateutil',
'scikits.statsmodels',
A bug in PyCharm perhaps? Are you able to import the new library in
IPython or the regular Python interpreter? (import pandas; print
pandas.__version__). You might also delete the pandas 0.3.0 egg if it
exists? Various people seem to be having trouble occasionally
installing on top of EPD and I wonder if EPD has some tricks under the
hood for enpkg that are screwing things up. Editing "private" files
like that is not something I'd recommend to anyone.
Must be some kind of EPD specific thing (I use EPD 64-bit on OS X too
but I run pandas in "develop" mode).
I don't think so. The pandas/ directory in site-packages is the only
place where the old code would be. If the OP really wiped it out and
installed a new version, then pandas.__version__ would not report the
old version. The metadata is only important to the package manager,
not runtime imports. Perhaps PyCharm was not configured to use EPD,
but rather a different Python that had an old pandas installed, too?
For future reference, the best way to remove an EPD egg cleanly is the
following:
$ enpkg --remove pandas
I recommend doing so before installing newer versions of things that
come packaged with EPD.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco