I am using Eclipse 4.2.1 with the pydev Plugin (version 2.7.1) for python development.
It seems that pydev has problems with precompiled python files (*.pyc files). I am using a package which is only provided with such precompiled files.
When importing a module, pydev shows "unresolved import" error. And also tool tips are not provided for such precompiled modules.
But the code can be executed without any errors.
Is there any way to "teach" pydev, how to deal with *.pyc files?
It seems like a bug. There is similar tread at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4651083:
Related
Error: The selected wizard could not be started.
Plug-in org.python.pydev was unable to load class org.python.pydev.ui.wizards.project.PythonProjectWizard.
An error occurred while automatically activating bundle org.python.pydev (547).
This error occurs as a result of installing the wrong version of PyDev for the version of Eclipse that you're using (found a hint on SO here).
For example, I (Edit: used to) use Eclipse Luna (Service Release 2, v4.4.2). I tend to lose my plugins / settings every time I update Eclipse on a Mac, and I'm too lazy to look into why, so I've avoided updating. Which is how I ran into the problem you describe here.
The version of PyDev available in the Eclipse Marketplace is, as of this writing, 6.5.something. You'd think Eclipse would be smart enough not to allow incompatible plugins to be installed with the Marketplace installer, but nope.
Look here for an idea of which version of PyDev you need to work with your version of Eclipse (check the "About" box within Eclipse), then follow the instructions here to download the appropriate .zip from SourceForge, extract it, and move the extracted files into the dropins directory, preserving the hierarchy that existing inside the archive.
For Eclipse Luna (4.4), I found that PyDev 5.2.0 seems to work fine (so far).
Note that the location of the dropins folder may vary by operating system. Once upon a time, I bookmarked this reference (for Luna) from the Eclipse help, and it may be useful somehow.
I have current version of Pycharm Community Edition 2017.2.4 installed on Linux and on Windows.
In the one working on Windows, I open non-project files and while I write code in them, there is autocompletion for in-project modules, classes, etc.
On the Linux (Debian) however, when I write code in non-project file , there is autocompletion only for non-project modules.
Some additional info:
Those in-project modules are installed via PIP on both systems in the same way:
pip install -e .
I can run non-project files importing those project modules in both cases.
On Linux I use virtual-env but have set correct project interpreter (as suggested in similar question: Why isn't PyCharm's autocomplete working for libraries I install?)
It looks like autocompletion uses system interpreter for those non-project files only. I have loaded several projects and in one of them there is autocompletion for the other.
Ok, I found out the problem was not with OS.
To turn on autocompletion for non-project files it is needed to add libraries you use to External libraries. Instruction how to do this is in https://stackoverflow.com/a/24206781/4601890
I have installed openpyxl. Working through the examples in Idle, I encounter no issues.
Trying to use my VisualStudio python editor, module imports fail.
Does openpyxl need to be added to IronPython for this to work? If so, how?
openpyxl does not work with IronPython. But that should not affect using it with VisualStudio. Presumably you need to set the path for the project.
PyDev has its own jython interpreter, inside pydev.jython.VERSION
that jython has its own python libraries i.e. pydev.jython.VERSION/LIB/zipfile.py
Now if I write a jython script for pydev-jython-scripting, it will load only its internal Lib pydev.jython.VERSION/LIB/
How do I have this pydev-jython recognize PYTHONPATH, I tried appending to sys.path but there is some python version problem some invalid syntax
My system python installation has all the .py source, my pydev interpreter configuration has python interpreter setup and NOT jython and NOT ironpython
pydev-jython script does not recognize many of regular system python modules, why?
The version that PyDev uses internally is Jython 2.1, so, you can't add newer libraries to that version unless they're compatible...
If you need to use a different version, you'd need to first update the version used inside PyDev itself (it wasn't updated so far because the current Jython size is too big -- PyDev has currently 7.5 MB and just the newer Jython jar is 10 MB -- with libs it goes to almost 16 MB, so making PyDev have 22 MB just for this upgrade is something I'm trying to avoid... now, I think there's probably too much bloat there in Jython, so, if that can be removed, it's something that may be worth revisiting...).
It seems that Pydev (1.5.4) on Eclipse (3.5.1) with Python 2.6 isn't able to correctly cross-reference the package gobject. Putting import gobject works OK but any more than that (e.g. class X(gobject.GObject) causes Pydev to report "unresolved reference" errors.
What could be the problem?
Note that every other package I use doesn't trigger this error.
The issue is related to this limitation of PyDev:
I have a library installed and Pydev
does not find it
Well, problems have been reported on
Mac and Linux, and the main reason
seems to be symlinks. Pydev will only
find extensions that are 'really'
below the python install directory.
This happens because the 'less common
denominator', which in this case is
windows, does not have symlinks. A
workaround to this problem includes
manually adding the given folder
installation to the pythonpath or
changing the installation of the
package to be under the site-packages
folder.
To adjust for this limitation, find the absolute path to the library and update the libraries associated with the interpreter for Pydev.