ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Pandas install on ERPnext VM




I am trying to setup pandas on the ERPnextVM in order to use it in a basic data analysis script.

I tried installing it normally pip install pandas it raised conflicting errors, i tried adding it in a new app and running bench setup requirements but it doesnt seem to install it.

The error log is:

numpy.f2py.f2py2e: module references file
numpy.f2py.setup: module references file
numpy.lib.utils: module references file
numpy.lib.utils: module references path
numpy.lib.utils: module MAY be using inspect.getsource
numpy.lib.utils: module MAY be using inspect.getsourcefile
numpy.testing.nose_tools.noseclasses: module references file
numpy.testing.nose_tools.nosetester: module references file
numpy.testing.nose_tools.parameterized: module MAY be using inspect.stack
numpy.testing.nose_tools.utils: module references file
creating /usr/local/lib/python2.7/dist-packages/numpy-1.14.1-py2.7-linux-i686.egg
Extracting numpy-1.14.1-py2.7-linux-i686.egg to /usr/local/lib/python2.7/dist-packages
Adding numpy 1.14.1 to easy-install.pth file
Installing f2py script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/numpy-1.14.1-py2.7-linux-i686.egg
Searching for pytz>=2011k
Best match: pytz 2018.3
Processing pytz-2018.3-py2.7.egg
Moving pytz-2018.3-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding pytz 2018.3 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/pytz-2018.3-py2.7.egg
Finished processing dependencies for pandas

Any help is welcome.




The solution was

sudo easy_install pandas, it worked after many failures.



Looking out for a pandas experienced person on ERPNext for stock pivots by warehouse, item group, brand, etc.


Yup pivot tables are the way to analyse data, plot and isolate trends, or troubleshoot missing data.

This ‘sales funnel’ tutorial has lots of q&a comments

This OReilly one uses a Titanic passenger dataset for multivariable pivot table sex, age, class, fare, and second birthrate data example.

The first tutorial uses just the command line while the second one uses the Jupyter notebook code workspace. Both environments require some ‘terminal console’ skill.

The question is, to what degree anyone has mashed pandas into ERPNEXT or limited to manual command line intervention cases?


I am trying to use pandas on a script report so the challenges I see are:

  1. How to prepare data from frappe.db.sql to be able to present as raw_data into pandas.
  2. How to convert data from pandas.crosstab into a format that can be used as data return back to the grid from the report.

issue 1. Currently the frappe.db.sql outputs dictionary of row values where as pandas expects in a dictionary of column values.
issue 2. Currently the pandas.crosstab outputs in a dataframe format native to pandas and visible on console, but the data to be returned from the script is a row list of column list.

Not sure if my analysis is correct, but that’s what it looks like.

If anybody has managed to make a script report with pandas, an example will be appreciated.