Sublime text 2 can not find any python module
Sublime text 2 can not find any python module
I am leaning programming now and get stuck in the very beginning.
I have sublime text 2 installed on my Mac, and I type some python code in and it runs. However, when I start to import module like pandas/matplotlib, it can not find those modules. Certainly I have used pip to install them.
So what is the solution please?
1 Answer
1
Does Your code work with those modules when You use a different editor?
If it doesn't, Check if the modules You need are indeed installed. You can do this either by using the python prompt:
python
>>> help("modules")
>>> exit()
or using pip:
pip freeze
(sorry for posting this as an answer, but I'm currently not able to post comments)
Checkout this post: stackoverflow.com/questions/27179268/….
– SpitGlued
Aug 23 at 10:56
I have created another build file, as my terminal is showing python 2.7.11 and sublime text 2 showing 2.7.10, but it doesn't help
– Victor
Aug 23 at 12:18
did You try to change the PYTHONPATH variable like is suggested in the article above: Once Anaconda is installed, its Python distribution supercedes the Python distribution that ships with OS X. You've installed Pandas on the former distribution (or rather, it's come pre-installed), while Sublime Text is relying on the latter distribution to build and run. You'll want to modify Sublime Text to use the Python distribution from Anadonda. You can modify Python.sublime-settings as shown in stackoverflow.com/questions/8574919/…
– SpitGlued
Aug 23 at 13:17
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
thanks for your reply. Sublime Text 2 gives importError: No module named pandas, whereas when I type code in terminal in MAC, it doesn't complain
– Victor
Aug 23 at 10:40