Dear Statalist,
I am having difficulties in setting up Python in Stata16. I have read several threads from this forum (e.g. https://www.statalist.org/forums/for...le-not-working) but still cannot find a solution to my problem.
I am running Stata16 on macOS 10.15.4. My current version of Python is 3.74 which works just fine with IDEs such as Jupyter Notebook and Spyder.
Please find below the output of a few Stata command lines (in the example I am trying to import seaborn.) which I hope will provide you with enough information to help me.
Many thanks in advance
Best,
PG
I am having difficulties in setting up Python in Stata16. I have read several threads from this forum (e.g. https://www.statalist.org/forums/for...le-not-working) but still cannot find a solution to my problem.
I am running Stata16 on macOS 10.15.4. My current version of Python is 3.74 which works just fine with IDEs such as Jupyter Notebook and Spyder.
Please find below the output of a few Stata command lines (in the example I am trying to import seaborn.) which I hope will provide you with enough information to help me.
Many thanks in advance
Best,
PG
Code:
. python search
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Python environments found:
/usr/bin/python
/usr/local/bin/python3
/usr/local/bin/python3.7m
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
. python query
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Python Settings
set python_exec /opt/anaconda3/bin/python
set python_userpath /opt/anaconda3/lib/python3.7/site-packages
Python system information
initialized yes
version 3.7.4
architecture 64-bit
library path /opt/anaconda3/lib/libpython3.7m.dylib
. python
----------------------------------------------- python (type end to exit) -----------------------------------------------------------------------------------------------------------
>>> import sys
>>> print(sys.path)
['', '/Applications/Stata/ado/base/py', '', '/opt/anaconda3/lib/python37.zip', '/opt/anaconda3/lib/python3.7', '/opt/anaconda3/lib/python3.7/lib-dynload', '/opt/anaconda3/lib/python
> 3.7/site-packages', '/opt/anaconda3/lib/python3.7/site-packages/aeosa', '.', '/Applications/Stata/', '/Applications/Stata/ado/base/', '/Applications/Stata/ado/base/py', '/Applicat
> ions/Stata/ado/site/', '/Applications/Stata/ado/site/py', '/Users/peppegrass/Library/Application Support/Stata/ado/plus/', '/Users/peppegrass/Library/Application Support/Stata/ado
> /plus/py', '/Users/peppegrass/Library/Application Support/Stata/ado/personal/', '/Users/peppegrass/Library/Application Support/Stata/ado/personal/py', '~/ado/', '/opt/anaconda3/li
> b/python3.7/site-packages']
>>> import seaborn as sns
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/anaconda3/lib/python3.7/site-packages/seaborn/__init__.py", line 6, in <module>
from .rcmod import *
File "/opt/anaconda3/lib/python3.7/site-packages/seaborn/rcmod.py", line 5, in <module>
from . import palettes, _orig_rc_params
File "/opt/anaconda3/lib/python3.7/site-packages/seaborn/palettes.py", line 12, in <module>
from .utils import desaturate, set_hls_values, get_color_cycle
File "/opt/anaconda3/lib/python3.7/site-packages/seaborn/utils.py", line 7, in <module>
from scipy import stats
File "/opt/anaconda3/lib/python3.7/site-packages/scipy/stats/__init__.py", line 379, in <module>
from .stats import *
File "/opt/anaconda3/lib/python3.7/site-packages/scipy/stats/stats.py", line 180, in <module>
import scipy.special as special
File "/opt/anaconda3/lib/python3.7/site-packages/scipy/special/__init__.py", line 641, in <module>
from ._ufuncs import *
ImportError: dlopen(/opt/anaconda3/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so, 2): Symbol not found: _main
Referenced from: /opt/anaconda3/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so
Expected in: flat namespace
in /opt/anaconda3/lib/python3.7/site-packages/scipy/special/_ufuncs.cpython-37m-darwin.so
r(7102);
>>> end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
.

Comment