3
我在使用VS2012中的python導入時遇到問題。在使用導入時,我無法讓項目編譯/運行。如果我沒有任何導入,python將運行主ok(並打印「hello world」)。這似乎是VS的錯誤,也許是一個配置,因爲當我禁用VS中的異常,它運行良好。Python導入在VS2012中不起作用
起初它錯誤說:
[WinError 2] The system cannot find the file specified
如果我繼續幾次它然後顯示:
[WinError 2] The system cannot find the file specified: 'C:\\Users\\Drew Cross\\Documents\\Visual Studio 2012\\Projects\\Test\\Model\\__init__.pyd'
然後,它最終運行一對夫婦更後繼續。
我有以下目錄結構:
main.py
Model
/__init__.py
/graph.py
main.py:
import Model.graph
def main():
print('Hello World')
if __name__ == '__main__':main()
graph.py:
class graph():
def __init__(self):
neighbors = []