title: Python module can't be imported when triggered by launchctl script in macos
body: <p><a href="https://i.stack.imgur.com/AEyiB.png" rel="nofollow noreferrer">The python program(apple.py) which wanted to be triggered by launchctl script,written under python2.7 in anaconda </a></p>
  
  <p><a href="https://i.stack.imgur.com/3mjCU.png" rel="nofollow noreferrer">The launchctl plist script(com.tushare.refreshall.plist) which was used to trigger the python program</a></p>
  
  <p>I try to use a plist script to launch my python program but in vain,in the program,i import a package tushare,but "ImportError: No module named tushare" returned in log file "stderr",this package can be successfully imported in python program written in anaconda.</p>
  
  <p>Results:</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "/Users/jacksonshawn/PythonCodes/apple.py", line 8, in &lt;module&gt;
  import tushare as ts
  
  ImportError: No module named tushare
  </code></pre>
  
  <p>Guess maybe it's due to "EnvironmentVariables" parameter missing in plist script,but i don't know how to amend the plist script to fix the problem.Every time,i do the following to execute the script.Syntax checked with the Plist script,it can be executed. </p>
  
  <pre><code>"launchctl unload -w com.tushare.refreshall.plist"
  
  "launchctl load -w com.tushare.refreshall.plist"
  
  "launchctl start com.tushare.refreshall.plist"
  </code></pre>