How can I add a project specific #INC module-path to Komodo without breaking syntax checking? - perl

For a Perl porting project I am using ActiveState's Komodo IDE 5.1
For external reasons, the xyz.pm modules reside in a different directory tree.
By adding a PERL5LIB=<> under the "environemt" tab of the debu/run dialog, I can show Komodo/Perl how to run the script.
Unfortunately the syntax checking doesn't seem to evaluate those directives and the IDE claims there was a fatal "can't locate xyz.pm" error, despite the fact that the script runs fine.
One way to fix this is to add the module path using the "Additional Perl Import Directories" under <Edit><Preferences><Languages><Perl>, but that is a global directive, not project specific, which leads to all kinds of interesting problems when module names collide.
So, how can I configure the Komodo IDE to store "Additional Perl Import Directories" [the #INC path for syntax checking] with the project?
EDIT: The suggested method of adding use lib qw'../lib'; might be helpful, if only I could make it execute in the IDE only. But this code must not show up in the production environment, where the start-up script sets the environment correctly.

For Komodo IDE 5.0.1:
Project (top menu bar) -> -> Properties -> Languages (left menu) -> Perl
This will allow you to add "Additional Perl Import Directories" which is what you want.

I have put a use lib qw'../lib'; to get Komodo to highlight correctly.
It just adds ../lib to #INC.

Related

Gtkmm in Eclipse makefile project: "could not be resolved"

I am trying to migrate a custom C++ project which uses Gtkmm3.0 to Eclipse (Oxygen) on Ubuntu 16.04. The project has its own Makefile and builds fine from the terminal within Eclipse. What I have not been able to do so far is tell the indexer about Gtkmm, and I get lots of these (which is very annoying):
When I hover over the little red bugs, it says:
Type 'Cairo::RefPtr<Cairo::Context>' could not be resolved.
I have done a lot of Googling on this and found nothing so far because all answers seem to assume the project's build tools are managed by Eclipse (See this or this, for example). In my case I have a makefile project instead of an executable project and hence some options are not available to me. For example, the first links speaks about configuring the builder:
We have to add all this directories. On Eclipse select the Project->Properties menu option. Select C/C++ Build->Settings property page and GNU C++ Compiler->Directories from the Tool Settings tab. Now we have to add all directories. In my case (Makefile project) only two tabs are available there: Binary Parsers and Error Parsers.
How can I tell the Eclipse indexer I am using Gtkmm3.0?
Found the solution that works for me:
Open a terminal and enter:
pkg-config --cflags gtkmm-3.0
You will see a list of includes directories (starting with -I). These are the directories you want to add in Eclipse so that it can locate the Gtkmm symbols in the editor.
In Eclipse, go to:
Project -> Properties -> C++ General -> Paths and Symbols
In the Includes tab, select GNU C++. You need to add here add the include directories found in step 1. There is no automated way to do this, yo must enter them one by one.
One trick that can save you some time is to edit manually the Eclipse project setting XML file and add the include directories directly in the XML file. By the end, you should have something that looks like this:
That did it for me, hope this helps!

How can Eclipse recognize MPI artifcats without errors?

I installed Eclipse for Parallel Applications and MPI v. 2.
I created inside Eclipse a new Hello World MPI project and run it using 4 processes. I can build and run it from Eclipse, it works.
Eclipse also recognizes MPI artifacts correctly.
I configured the includes as described here:
http://help.eclipse.org/juno/topic/org.eclipse.ptp.pldt.doc.user/html/includes.html
However I'm getting a lot of errors on MPI artifact on the source code, same errors as described in the above link:
The Indexer can't find your include file
"If the indexer can't find your MPI header file, you may see problems like the following:
If your MPI header file is located in a global area that automatically gets included in your project's include path location, such as /usr/include or /usr/local/include, then things will probably work just fine without further alteration. Building and indexing will probably both operate correctly.
If you do not use mpicc or a similar build command and need to specify include and libpath information on building and linking, you will probably want to set the PLDT preferences to point to your include path for MPI, in which case, the include and link arguments will be added to your build commands."
My code works but I think it is impossible to work with al these red lines on every MPI instruction.
So my question is: how can I configure Eclipse in order to recognize MPI functions without telling me that there are errors?
Using Ubuntu 64 bit with last version of MPI and Eclipse.
I found a fix:
Right click on project -> Properties -> C/C++ General -> Paths and Symbols
On tab "Includes" click on "GNU C" and then on "Add.."
"/usr/include/mpi"
rebuild
It sounds like Eclipse does not include directories recursively.
Source: http://tinyurl.com/nkq2gwp [pages 35-36]
The link you posted seems to have all the answers that you're going to get here. Are you sure that your "mpi.h" header file is in the location you put in your include path in Eclipse? It seems that you may have the wrong path.

Pydev: Go to arbitrary module source?

In Pydev, is there a convenient way to open arbitrary (external, globally installed) module? Say, I want to see the source of markdown.blockprocessors module. How can I do that without typing an import directive (import markdown.blockparser), using "Go To Definition" (F3) and removing the directive? It would be nice to see the hierarchy of the whole markdown package in the Package Explorer, but I don't know how.
There are 2 main ways of finding something without using F3:
Open Resource action (Ctrl+Shift+R): allows you to find any file in your workspace (so, it's useful not only for python modules, but any file, but those need to be in your workspace).
The PyDev tokens browser (Ctrl+Shift+T): allows you to find any token (class/method/attributes/globals -- but currently not module name) for modules in the PYTHONPATH (either source folder or external libraries under the project properties > pydev pythonpath). You can filter things as 'myproject.*something' (the dialog that opens provides instructions on how to filter tokens).
Add Markdown source code folder here::
Project properties -> PyDev PYTHONPATH -> Source folders.

Pydev say, "Unresolved import" error

hm..
Sometime, PyDev say "Unresolved import error".
In my environment
Python2.6.6 Eclipse3.7 PyDev2.2.2
Errors are.
> Unresolved import: pycassa -> import pycassa Unresolved import:
> WebSocketHandler -> from geventwebsocket.handler import
> WebSocketHandler Unresolved import: tweepy -> import tweepy
Is there any helpfull information?
Had the same problem. In the end I was able to fix the problem by deleting my old interpreter in Preferences > PyDev > Interpreters, and creating a new interpreter called "python" which had the correct paths. After quitting and reopening eclipse, pydev found all my modules.
Probably your PYTHONPATH is not set properly (or if those are libraries in the interpreter, maybe you added them after configuring it).
See: http://pydev.org/manual_101_interpreter.html for references (note the part on forced builtins there as it might be your case).
You get an unresolved import if the required module cannot be found. Modules are searched for in the current working directory and the directories listed in sys.path. Your python cannot find the modules pycassa and tweepy it appears.
Might want to check this: http://klaith.wordpress.com/2009/06/12/pydev-unresolved-import-errors/
I solved by recreate the interpreter. There is a guide at pedev.org:
What if I add something new in my System PYTHONPATH after configuring
it?
If you add something to your python installation, you need to either
add it manually as a 'new folder' in the System PYTHONPATH (if it's
still not under a folder in the PYTHONPATH) or (recommended) remove
your interpreter and add it again, then, press apply.
Note that if you added a library that's already under a folder in the
PYTHONPATH, you have to at least go to the interpreter preferences and
press apply so that it clears its internal caches (after the
configuration is done, things are set in stone for PyDev)
Thanks for Fabio Zadrozny and nicodjimenez.
I had a similar problem before. I solved the problem by this steps:
1)Window > Preferences > PyDev > Interpreters > Python Interpreter
2)Delete the Python Interpreter path you added previously
3)Add "New" Python Interpreter and choose python.exe path
4)Check Libraries tab (I found the problem at this step.)
Check your path name, is it true or false? Eclipse detect "C:\Python27\lib" but it should be "C:\Python27\libs" and "C:\Python27\Lib".
In the properties for your pydev project, there's a pane called "PyDev - PYTHONPATH", with a sub-pane called "External Libraries". You can add source folders (any folder that has an init.py) to the path using that pane. Your project code will then be able to import modules from those source folders.
Check this two links it may be helps to you,
Unresolved Import Issues with PyDev and Eclipse
Unresolved import: models
Is pycassa found as a symlink within a directory on your PYTHONPATH? Pydev apparently has a bug where its code analysis cannot follow symlinks (and hence will not see your libraries). The python interpreter can though of course.
I was having a similar problem with the dbfpy module.
I had downloaded the tar archive and installed the source files in /usr/lib/python2.7/dist-packages
With this I was able to import the packages in IDLE and even run the code in Eclipse. However the pydev import was still showing as an error with the message "unresolved import"
As suggested by Fabio, I checked the PyDev documentation for forced-builtins. Just adding the name of the package ("dbfpy" in my case to the Forced Builtit tab of Python Interpretr in Eclipse) solved the issue.
(I know the answer is a bit late)
if you installed a python package using, for example: pip install django
i solved the unresolved import issue doing this:
In eclipse:
Window > Preferences
In the left panel tree structure go to:
PyDev > Interpreter - Python
In the upper right panel be sure to have the correct interpreted selected
and in the bottom right panel, click New Folder, navigate to your python installation site-packages (usually in c:\Python33\Lib\site-packages) and search for a folder that ends with .egg-info
In my pc it is "C:\Apps\Environments\Python33\Lib\site-packages\Django-1.5.4-py3.3.egg-info" since i installed python in C:\Apps\Environments, should be different in your case.
This worked with django and selenium, should work with all others as well (as far as i know)
Adding the corresponding package folder ending with '.egg-info' to PyDev > Interpreter - Python - library will resolve the problem.
In Linux, it is usually under /usr/local/lib/pythonX.X/dist-packages
Add site-packages path in environmental variables.
Right click on
computer -> properties -> advanced system settings -> Environmental
variables
.
After that is done, remove the python interpreter and add it again in eclipse.
right click project name in
eclipse --> properties --> python interpreter
.
Hope it works.

How do I set the build path for E-P-I-C in Eclipse Galileo?

I have E-P-I-C installed on Eclipse Galileo. When I go to run a Perl script nothing happens because I don't believe is any connection from Eclipse to the Perl SDK (is that the right term? I don't know if it is different because it's Perl).
I'm pretty sure it has something to do with C:\Perl\bin
If I click on Perl E-P-I-C project and click on properties I can then see
Perl include Path. I have added the above but it didn't change anything.
What this comes down to is: How do I set up the build path for Perl in Eclipse Galileo?
Normally, the PerlDistribution asks to be added to your %PATH%. For me it added D:\strawberry\c\bin and D:\strawberry\perl\bin. My Eclipse Galileo uses that environment variable out of the box.
You can set the perl executable for a .pl file using Window->Preferences->Perl EPIC and use the File Selector. Works for me with strawberry and standard cywin perl. The perl version shipped with MsysGit seems like it can't handle EPIC breakpoints. Haven't tested with ActiveState Perl so far.
Vista user here. I have Activestate Perl and it also installed into c:\perl5.10, and added the executable to the %PATH%.
Thus, In my Window/Prefrences/Perl EPIC Menu, the executable is called "perl". No .exe, no absolute path. E-P-i-C has probably found it by searching in the default install locations.
In eclipse, you need to run your perl script once using a right mouse click "run as ...perl local".
THen this script shows up in the Menu "Run > Run configurations." For simple scripts, the default values in the tab dialogs are all ok (most are empty). Output is written to the console window. Make it visible using Menu Window > View > Console.
Does your perl script generate any output?
Perl Debugging from Eclipse does not work for me either. A dialog box pops up and says I shpuld read the discussion thread for ticket #290... on sourceforge. A very complex matter indeed.