JeremyR
Before I embark on this process I just have a couple of questions.

I want to be able to import the python's Pandas framework into Soup's python node in order to handle external data files and then extract that data to use as text labels, object position, scale rotations etc.

Firstly is the python node able to handle this? If so what do I need to do so that the python node can import the frameworks ie do I need to setup any environment pathways, how do I do this?

cheers
Reply 0 0
pshipkov

Which python node you are referring to ?

PyExpression ?

If so - it is a standard python "shell". So if you have packages and modules properly installed - it will take them right away.

Reply 0 0
JeremyR
Yes, PyExpression.
Looks like I need some help though.

Ive opened up a window in terminal and CD'd into my pythonpath:
"/Applications/Autodesk/maya2019/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.7/plat-mac/lib-scriptpackages"

I ran
"pip install pandas"

But got this message:
"Requirement already satisfied: pandas in /Applications/anaconda3/lib/python3.7/site-packages (0.24.2)"

Why wont pip install into my current directory?
Reply 0 0
JeremyR
Okay, I appended the anaconda3 path with sys.path.append but its now calling out for a numpy dependency which is strange because numpy is also in the same place as pandas.

"# Error: ImportError: file /Applications/anaconda3/lib/python3.7/site-packages/pandas/ __init__.py line 19: Missing required dependencies ['numpy'] # "

Any ideas?
Reply 0 0
JeremyR
Okay things just get weirder. Ive updated my numpy and pandas install, possibly some extensions needed it. Thing is when building using Pandas on another project outside of maya using the anaconda pathway way above they build fine. But when inside maya now its saying the module doesnt have the attribute ".DataFrame" so it seems Maya imports pandas but not its attibutes?

BTW Im just using a python shell in Maya's script editor.

import sys
sys.path.append("/Applications/anaconda3/lib/python3.7/site-packages")
import pandas as pd
d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
df
Reply 0 0
pshipkov
Hard to tell what the problem is, but i remember from the distant past that bringing custom modules to Maya's embedded Python caused some extra work. Search online about that stuff.
Reply 0 0
JeremyR
Found the problem, anaconda had installed a version of pandas compatible with 3.0 only, Python for Maya uses 2.7. 
Reply 0 0
pshipkov
Good to know it works.
Reply 0 0
Reply