I use the Anaconda suite for python. I do
import pandas as pd
and then
pd.show_versions()
it shows
pandas: 0.17.1
but if I do
!conda list
it shows
pandas 0.18.1
Why are those different ? Why is the imported pandas version less up to date than the one in conda ? Some attributes do not work for me at this stage (like .rolling) which is a great hassle.
I've already triedconda update pandas
and then restart spyder, but without any luck
Thanks a lot for your help
----EDITS :
pd.__file__
returns
Out[16]: 'C:\Anaconda3\lib\site-packages\pandas\__init__.py'
sys.executable
returns
'C:\Anaconda3\python.exe'
I've tried sys.path
which returns
Out[15]: ['', 'C:\Anaconda3\python35.zip', 'C:\Anaconda3\DLLs',
'C:\Anaconda3\lib', 'C:\Anaconda3',
'c:\anaconda3\lib\site-packages\setuptools-23.0.0-py3.5.egg',
'C:\Anaconda3\lib\site-packages',
'C:\Anaconda3\lib\site-packages\Sphinx-1.4.1-py3.5.egg',
'C:\Anaconda3\lib\site-packages\win32',
'C:\Anaconda3\lib\site-packages\win32\lib',
'C:\Anaconda3\lib\site-packages\Pythonwin',
'C:\Anaconda3\lib\site-packages\IPython\extensions',
'C:\Users\jeanbaptiste.lepetit\.ipython',
'C:\Anaconda3\lib\site-packages\IPython\extensions',
'C:\Anaconda3\lib\site-packages\IPython\extensions']
pd.__version__
returns
'0.17.1'
It's quite confusing
----------EDIT 2 ----------------
Ok I figures packages where at two places
C:\Anaconda3\lib\site-packages\pandas
and
C:\Anaconda3\pkgs\pandas-0.18.1-np110py35_0\Lib\site-packages\pandas
I manually deleted the first one to see what would happen. then try to import the package : import pandas as pd
but it couldn't find it. Trying conda install pandas
returns
All requested packages already installed. packages in environment at C:\Anaconda3: pandas 0.18.1 np110py35_0
So I guess it is in this folder that all the conda
command go, but import
doesn't work. I've tried to add `C:\Anaconda3\pkgs' to the PATH, but with no luck.
Any idea ?
spyder
after updatepandas
version ? – jezraelpd.__file__
to see where the library is loaded from. – Sergey Bushmanovimport sys
and check the output ofsys.executable
to see if it points to the anaconda directory, or some other python executable. – root