开发者

Just downloaded TextMate, can't import modules

I am trying to use python in order to simulate social networks, this requires matplotlib.pyplot, networkx and xlrd. 开发者_开发技巧Everything works fine from terminal, IDLE or X11 but when I try to use TextMate import matplotlib.pyplot as plt and import xlrd throws up ImportError: No module named... however import networkx works fine!

I downloaded python via EPD and so matplotlib came ready baked in however I got xlrd and networkx with easy_install.

Anybody have an idea what might be going on?


You need to tell TextMate which Python to use. One way to do that is to define the shell variable TM_PYTHON with an absolute path to the Python interpreter you want to use. In the TextMate menu, select Preferences, then the Advanced tab, then the Shell Variables tab, and click + to add the new variable. If you don't know the absolute path to the EPD Python, type which python (or whatever you are using to start Python) in a Terminal shell window.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜