简体   繁体   中英

How to configure Sublime text 2 to use my installed python libraries

I just started using Sublime Text 2 and I can't seem to get it to work with most of the libraries I have installed for Python 2.7 for windows, every time I try to import them and run it, it gives me this message "C:\\Python27\\Python.exe: can't find ' main ' module in ''".

I tried configuring the Python.sublime-build but nothing I do to it seems to work, for reference this is what it has right now:

{
    "cmd": ["Python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

I'm learning to program and I've only used IDLE so far so I'm very new to Sublime, I'm most likely missing something, if you guys can help I would really appreciate it.

Seems to be a year late but for this kind of problem, I think you just test by running on a "untitled" file (which means you didn't save it under .py file). You have to save it then run it.

The point is sublime text will call the cmd, call python in command line and pass the python script file name to it. If you don't save the file, it's like calling python.exe to run on nothing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM