I want to create a command line with python (argparse). The goal is to import a dataframe and then print its 5 first rows, however, when I run the command, this error shows up :
File "try.py", line 3, in <module>
import pandas as pd
File "C:\Users\szouaoui\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\__init__.py", line 17, in <module>
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
ImportError: Unable to import required dependencies:
numpy: DLL load failed: Le module spécifié est introuvable.
it seems that the program is unable to import the pandas library
here is the code:
import argparse
import sys
import pandas as pd
my_parser = argparse.ArgumentParser(description='Unconstraining demand for specified dates, shops and categories/n')
my_parser.add_argument("path",type=str, action="store")
my_args = my_parser.parse_args()
input_file = sys.argv[1]
data = pd.read_csv(input_file)
print(data.head())
command line :
python try.py /path_to_file/dataframe_name.csv