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.
Hello,

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

Output:
. 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
Error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/stats/__init__.py", line 379, in <module> from .stats import * File "/users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/stats/stats.py", line 180, in <module> import scipy.special as special File "/users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/special/__init__.py", line 641, in <module> from ._ufuncs import * ImportError: dlopen(/users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so, 2): Symbol not found: _main Referenced from: /users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so Expected in: flat namespace in /users/jprenderg/opt/anaconda3/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so
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.