本文介绍了Eclipse PyDev ImportError:没有名为src.somesrcfile的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Python开发的新手,最近我将Pydev安装到Eclipse中。



我发现了几个Django应用程序,我首先尝试执行它们。 >

但是我收到错误:

  ImportError:没有名为src.stockMain4的模块
错误:模块:src.stockMain4无法导入(文件:C:/Users/ceren/Desktop/ayyeka-m2m-master/project1/SOAPStock/src/stockMain4.py)。

我搜索了这个错误,似乎路径有问题,但解释是关于Linux,我找不到一个很好的Eclipse源代码和这个错误。



你认为有什么问题?



提前感谢

解决方案

问题似乎是你的模块应该是stockMain4(而不是src .stockMain4)。 - 在某些情况下,无需查看代码或至少完整的堆栈跟踪(但可以查找可能引用src.stockMain4的位置)来诊断问题究竟在哪里。


I am new to Python development and I recently installed Pydev to Eclipse.

I found a couple of Django applications and I firstly tried to execute them.

However I got the error:

ImportError: No module named src.stockMain4
ERROR: Module: src.stockMain4 could not be imported (file: C:/Users/ceren/Desktop/ayyeka-m2m-master/project1/SOAPStock/src/stockMain4.py).

I searched for this error, it seems like there is something wrong with paths, but the explanations are about Linux, and I could not find a good source for Eclipse and for this error.

What can be the problem you think?

Thanks in advance.

解决方案

The problem seems to be that your module should be just stockMain4 (and not src.stockMain4). -- It's a bit hard to diagnose where exactly is the problem without taking a look at your code or at least the full stack trace (but look for places which may reference 'src.stockMain4').

这篇关于Eclipse PyDev ImportError:没有名为src.somesrcfile的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 23:58