Python can't find '__main__' module in ''
来源:互联网 发布:电脑网络维护培训 编辑:程序博客网 时间:2024/05/18 02:32
st2已经很完善了,以前没有使用过build。似乎st2的build system已经很完善了,何为build?大概就是它自动帮你调用程序运行所需的组件吧。中文资料比较少,我在试用python的时候,就打算直接在st2 build出来。这样就像极一个IDE了。
在bulid之前,肯定是要先配置好的。首先是Preferences下面的Brower packages,打开之后就看到有一个Python的文件夹。看看里面有没有一个Python.sublime-build 这样名字的文件,如果没有则新建一个。
里面的内容应该是这样的
{"cmd": ["python", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python"}
然后检查Python有没有加入环境变量path中
C:\Python27
最后,就可以在st2中build了,新建一个build system,或者使用默认配置,如果你的机器中有多个Python的版本,那么你就应该新建一个python的build。选择好适合的build之后,ctrl+b就可以build了。
print 'hello,world.' //print在python3以后使用print()hello,world. [Finished in 0.1s]
*如果你没有保存一个文件就build,有可能出来以下的错误:
C:\Python27\python.exe: can't find '__main__' module in ''
把它保存在Python能够解析的目录,一般是你设置了在环境变量中的那个目录,以便Python能够运行起来。
0 0
- Python can't find '__main__' module in ''
- Python can't find '__main__' module in ''
- sublime text2 python error message /usr/bin/python: can't find '__main__' module in ''
- (已解决)sublime text 写程序build后提示can't find '__main__' module in ' '
- sublime text 写程序build后提示can't find '__main__' module in ' '
- 多进程---错误解决AttributeError: Can't get attribute 'long_time_task' on <module '__main__' (built-in)>
- module rewrite_module is built-in and can't be loaded
- gyp ERR! stack Error: Can't find Python executable 'python'
- Can't find dll entry point GetModuleHandleA in kernel32
- can't find /mnt/cdrom in /etc/fstable……”
- Can't find asoundlib.h in Ubuntu 10.04
- can't find recovery API version in input target-files
- go test can't find function in a same package
- can‘t find lmysqlclient
- "can't load apple.laf.AquaLookAndFeel" (Ant in Eclipse can't find it)
- 【angular】Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'D
- js -- can not find module
- can't rename root module
- 保障MySQL数据库安全的14个最佳方法
- 安装Microsoft Visual Studio 2005,找不到vcredist.msi
- 找点
- 关于在myEclipse中对所有的文件进行相应的搜索的做法
- AFNetworking速成教程(1)
- Python can't find '__main__' module in ''
- java 集合的常用操作(排序、查找、打乱顺序)
- 操作系统中的调度
- 防弹组合,教训内幕,Kipley J. Lytel终审法院,Montecito的资本
- MySQL开发者需要了解的12个技巧与窍门
- css3中的transform中的matrix(矩阵)
- 黑马程序员------------方法参数返回值
- 接听服务为生命的救星
- 关于研究方向寻找