在 pydev 上使用 python 自动完成错误? [英] Bad auto completion with python on pydev?

查看:51
本文介绍了在 pydev 上使用 python 自动完成错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大约一个月前我开始学习和热爱 Python.深入研究 python、django,现在 Tornado 是我在此期间遵循的路径.我选择 pydev 作为 IDE,因为它似乎是最新的,我想回到 Eclipse,因为我将 Netbeans 用于 php 和 Java.

I began learning and loving python about a month ago. Dive into python, django and now Tornado is the path i followed during this time. I chose pydev as an IDE since it seems to be the most up to date and i wanted to come back to eclipse since i'm using Netbeans for php and Java.

我的问题如下:当我在 php 或 java 中编写类时,我会声明我的方法和属性.我在其他地方实例化它们并使用它们.自动完成功能对 java 和 php 非常有用,但对于 python,它似乎总是向我暗示一堆垃圾,而从来没有从我实例化的类中推荐真实对象的方法.

My question is the following: When i write classes in php or java i declare my methods and properties. I instantiate them somewhere else and use them. The autocompletion works great for java and php but with python, it seems to be always suggesting me a bunch of garbage and never the real object's methods from the class i instantiated.

你也一样吗?这是 pydev 的限制吗?我做错了什么吗?

Is it the same for you ? Is it a limitation from pydev ? Am i doing something wrong ?

预先感谢您为我指明方向.马修.

Thank you in advance for pointing me in a direction. Matthieu.

推荐答案

首先确保您的 interpreter设置正确.

First make sure your interpreter is set up correctly.

Window | Preferences | Pydev | Interpreter - Python

我在 linux 上使用 cpython,所以我的解释器是

I use cpython on linux so my interpreter is

  cpython      /usr/bin/python25

在库下,确保所有标准的 PYTHONPATH 东西都在那里:

Under Libraries, make sure all the standard PYTHONPATH stuff is in there:

System Libs
  /usr/lib/python2.5
  /usr/lib/python2.5/site-packages
  /usr/lib/python2.5/wx-2.8-gtk2-unicode
  /usr/lib/python2.5/lib-tk
  /usr/lib/python25.zip
  etc....

您还可以通过单击新建文件夹"在此处添加任何非标准路径.

You can also add any non standard paths here by clicking New Folder.

尽管如此,请不要向您自己的源代码添加路径.当您配置 pydev 项目、选择src"文件夹并开始制作模块时,这些应该会出现,请参阅此处.

Do not add paths to your own source code though. These should come in when you configure a pydev projec, select a "src" folder and start making modules, see here.

这篇关于在 pydev 上使用 python 自动完成错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆