问题
I've been using Anaconda distribution(for NumPy,Pandas library). Recently I've tried to use Sublime Text 3. Problem is Sublime text cannot use my Anaconda installation. It is using the default python installation.
During Anaconda's installation, I've tried set it as global/default python setup and later also added anaconda/bin to my $PATH.
$ echo $PATH
/home/qfarhan/anaconda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
$ echo $PYTHONPATH
/home/qfarhan/anaconda/bin:
$ which python
/home/qfarhan/anaconda/bin/python
But for
import request
import pandas as pd
gives the error
import requests
ImportError: No module named requests
Immediately after the error it prints a path line:
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games]
Which does not contain the anaconda directory. So Sublime text 3 is using a different PATH than mine. Can someone help me to resolve this issue?
Thank you for your time.
回答1:
Try configure Python interpreter settings for Anaconda.
Please refer to Anaconda README.
Also did you start Sublime Text from the shell where you had the PATH set correctly?
来源:https://stackoverflow.com/questions/22321879/setting-path-for-sublime-text-3-anaconda-plugin