If I set a certain environment's executable for python, initialize it and import a package installed within that environment, I get no error.
However, now if I run a do-file that tries to run a certain python script, with the same executable and user path defined, I am getting ImportError.
To illustrate:
The following code block runs with no issue.
Code:
# set python executable and user path in stata. set python_exec /path/to/exec set python_userpath /path/to/package_dir # initialize python python # import pandas import pandas
Code:
# set python executable and user path in stata. set python_exec /path/to/exec set python_userpath /path/to/package_dir do "/path/to/do/file"
Code:
ImportError: No module named pandas
Code:
!python script.py
0 Response to ImportError after specifying set python_exec in Python integration
Post a Comment