zoukankan      html  css  js  c++  java
  • Eclipse + Pydev开发Python时import报错解决方法


    一.  原文链接:http://blog.csdn.net/lhanchao/article/details/51306626           
    用eclipse +PyDev开发python时,需要import其他文件时eclipse会报错,但是在python的命令行中运行却没有问题。
    据人分析其实发生错误的原因是在Preferences->Pydev->Interpreter-Python中的SystemPYTHONPATH 引用不完全,不知道你发现没有,在python3.1中的SystemPYTHONPATH比在python2.x中的少很多,而在python2.x中就不会出现类似的import错误。
    ------------------------------------------------------------------------------------------------------------------
    下面是问题的解决方法:

    1.右键工程——properties
    2.选择Pydev-Interface/Grammar,点击链接Click here to configure aninterpreter not listed
    3.在python Interperter中选择New Folder,添加文件的父目录即可。

    二.我的方法
       然并卵,添加配置之后会导致上层目录.. 的引用不能成功,于是换用PyCharm作为开发工具。
      使用Eric6和Pycharm混合,取代PyDev
  • 相关阅读:
    tp5 thinkphp5 伪静态修改 fastadmin
    ThinnkPHP内置视图循环语句
    PHP禁止重写策略
    冒泡排序
    Ruby--正则
    JS正则
    JS禁止父元素事件
    Rails--default_scope
    公网映射
    查企业情况和招聘的网站
  • 原文地址:https://www.cnblogs.com/wishchin/p/9199894.html
Copyright © 2011-2022 走看看