Python Forum

Full Version: STATA/Python Integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I'm running Spyder Python 3.3.6 from Stata/IC 16.1 for Mac (64-bit Intel):

. python query ------------------------------------------------------------------------------------------------------ Python Settings set python_exec /users/jprenderg/opt/anaconda3/bin/python set python_userpath Python system information initialized yes version 3.7.4 architecture 64-bit library path /Users/jprenderg/opt/anaconda3/lib/libpython3.7m.dylib
I am able to import SCIPY ok. But can't import the "Stats" sub-package:

>>> from scipy import stats
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/stats/", line 379, in <module> from .stats import * File "/users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/stats/", line 180, in <module> import scipy.special as special File "/users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/special/", line 641, in <module> from ._ufuncs import * ImportError: dlopen(/users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/special/, 2): Symbol not found: _main Referenced from: /users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/special/ Expected in: flat namespace in /users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/special/
Has anyone experienced this and solved the problem?

Note: "from scipy import stats" works fine from within Spyder. It seems to be a Stata issue.