我的python以某种方式无法在同一目录中找到任何模块。我究竟做错了什么?(python2.7)
所以我有一个目录“ 2014_07_13_test”,其中有两个文件:
- test.py
- 你好
在hello.py:
# !/usr/local/bin/python
# -*- coding: utf-8 -*-
def hello1():
print 'HelloWorld!'
和test.py:
# !/usr/local/bin/python
# -*- coding: utf-8 -*-
from hello import hello1
hello1()
还是python给我
>>> Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 4, in <module>
ImportError: No module named hello
怎么了?
import sys; sys.path