Python Forum
missing pandas even if in conda list - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: missing pandas even if in conda list (/thread-10632.html)



missing pandas even if in conda list - metalray - May-29-2018

Dear Python Experts,

I wonder why pandas is noted as missing even if I have it in my list.

(donkey) C:\Users\HOL\d2>conda list
# packages in environment at C:\Users\HOL\AppData\Local\Continuum\miniconda3\envs\donkey:
#
# Name                    Version                   Build  Channel
pandas                    0.23.0           py36h830ac7b_0
pip                       9.0.1                    py36_1
...

(donkey) C:\Users\HOL\d2>model_performance.py
Traceback (most recent call last):
  File "C:\Users\HOL\d2\model_performance.py", line 1, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'

(donkey) C:\Users\HOL\d2>
Any help is much appreciated.


RE: missing pandas even if in conda list - snippsat - May-29-2018

Use always python to execute a script.
If do it without python can use a OS system python version,and not the one in virtual environment.
Eg:
# Make environment 
G:\Anaconda3\Scripts
λ conda create -n donkey scipy pandas requests

# Activate enviroment
G:\Anaconda3\Scripts
λ activate donkey 

(donkey) G:\Anaconda3\Scripts
So at this point can check that right python is used in virtual environment.
I user cmder and can use which python
From cmd can do it like this.
(donkey) G:\Anaconda3\Scripts
λ which python
/g/Anaconda3/envs/donkey/python

# cmd
(donkey) G:\Anaconda3\Scripts
λ python -c "import sys; print(sys.executable)"
G:\Anaconda3\envs\donkey\python.exe
So when use python my_script.py it will use the Pandas version that i did make with conda create -n donkey scipy pandas requests


RE: missing pandas even if in conda list - metalray - May-29-2018

Awesome. Thanks!