PyDev: not seeing module within project - pydev

PyDev 2.5 and Django 1.4
I'm very new to this, and am probably making some stupid mistake, but I've looked around and can't figure out what I'm doing wrong...
After creating a new app within my project and then adding it to INSTALLED_APPS in the project settings file, I attempt to run the server (RunAs --> PyDev: Django) and get:
Error: No module named < appname >
Originally I thought this was being caused by the error reported here (error creating settings.py): http://sourceforge.net/tracker/?func=detail&aid=3512322&group_id=85796&atid=577329
But updating to the nightly build solved that. (Note: The project's Django module settings field remains blank initially, but it seems to find it when I type it in manually).
Yet it still can't find the app/module. Maybe I am just missing something obvious here, but I'm really not seeing it.
Please let me know if you need more information.
Thanks,
Ryan

This is probably an issue in the way you're writing your code and the PYTHONPATH that's configured...
For a better answer, please give more details on those (a screenshot from the pydev package explorer with your project structure and the INSTALLED_APPS setting should suffice).

Related

Issue running golang Hello World in eclipse

Alright, so just a disclaimer I suspect this question will be a duplicate of another question however I'm not even sure what to search for.
I have never used Eclipse or Golang before and am attempting to get a basic hello world application to work.
I have installed the goclipse plugin, created a new go package and go command source file. From what I have read to run a project in Eclipse you right click the package, select Run as then set the run configurations. The problem occurs when I attempt to select the go package as none shows up and if I leave it blank it throws a 'Go package not found' exception.
Thank you for any help you can provide.
EDIT: Upon the answers advice I have decided to go with the basic command line, however a friend did also recommend LiteIDE. I will "assume" tmichels answer is correct in regards to getting Go to work within eclipse.
If you don't use the GOPATH environment variable and you don't put your project folder under $GOPATH/src the compiler won't find it. As I see it goclipse lets you skip the GOPATH entirely but in this case you have to put your code under the src directory that you can see in the Project Explorer. See the related section of the goclipe documentation.
Although I think you make your life harder by using a full-fetched IDE for go development. Just use the command line tools. And it has the added benefit that you will actually understand what's going on (IDEs hide this from you).
So for building you can use go build or go install. The latter will copy the binary to your $GOPATH/bin directory. For running test just call go test or go test path/to/package. There is a hidden gem in the go tool: when you are working with multiple packages in the same directory you can use go test ./... to test all of them at once. This also works with other go commands.

Eclipse Build Error "A class file was not written. The project may be inconsistent, if so try refreshing this project and building it"

I have been struggling with a very weird issue that has suddenly popped up on the latest version of Eclipse Classic (4.2.2).
Everytime I try creating or refactoring a class or subclass in any of my projects (all Java) in my Eclipse workspace I get an error at the very top of my class that says
A class file was not written. The project may be inconsistent, if so try refreshing this project and building it
Again, this happens when I create new classes. And even when I rename current classes, then undo the renaming, its totally fine, but changing a single character in the name causes this error to happen for that specific class.
I have Auto Build on, and I tried multiple times to clean and refresh every project as well as restart Eclipse entirely.
I have literally no idea how to even start figuring out how to fix this. The solutions i've found through search didn't help, so i'm hoping I might find any clues here.
I had the same problem and here's how I solved it in the end:
It turned out that the disc space on the drive where workspace resides was full.
Silly mistake but worth checking.
In my case, this was caused by the fact that the build output directories were owned by a different user, and Eclipse could not write into them.
I had the same issues, the following worked for me:
Right click eclipse then running "as an Administrator"
Click Project > Clean.
Clean your workspace by starting eclipse from the command line with the -clean argument :
eclipse -clean
See also How to run eclipse in clean mode? and what happens if we do so?
I solved this problem by running Eclipse as root.
I had the same issue on Mac OS X. I had a maven project.
Try running the following command on Terminal. This looks like an access issue.
sudo mvn clean
Provide password for admin user.
Then open Eclipse and refresh your project.
We are using Eclipse here too and have to handle a workspace with more than 200 plug-ins. Every now and then people have similar problems with their workspace and inconsistencies reported in a weird way by Eclipse.
What people here usually do is (next step only in case previous step didn't help):
- trying to ContextMenu->Team->Clean/Refresh the whole workspace
- creating a new workspace and check out all necessary files from the repository
- reinstalling Eclipse to a new directory
From my experience after using the Eclipse IDE on a daily basis for many years, it doesn't make very much sense to waste too much time with these issues, unless they aren't solved by one of the steps above. It takes too much time to struggle with these things, while starting from scratch is done in an hour or less (and usually fixes the issue).
If your Eclipse still behaves strangely it might make sense to go through your installed plug-ins. Not all external plug-ins follow the Eclipse guidelines and can seriously harm the performance and operational consistency of your Eclipse installation (E.g. Sonar Plug-in, Toad Plug-in, ...)
In my case this kind of error caused due to disk space got full and it got resolved by just freeing disk space where eclipse have been installed.
That is c/d/e drivers.
I come up with the same error, and in my case, this is because the permission of the project/bin directory is not recursively 775
I fixed it by:
Remove the project/bin directory: sudo rm -rf project/bin
Switch to Eclipse, rebuild the project: Project->Clean...
Then no errors.
Try to launch Eclipse as Administrator.
In my case such error was caused by a question mark in a quoted method name (I use geb+spock combination for automated testing).
So this method name will throw an error "Do you want something?"()
And this will not "Do you want something"()
It may not be the best response but to fix it, I've just delete the error marker.
Had the same issue. but cleaning the project and restart eclipse didn't help and disk space was not the issue. Solved the issue by copy the code to notepad(just to not lose it) and then delete the class, recreate it and paste the code back in again.
I solved it changed the owner of the project files. I changed from root(old owner) to user my current(user that i use with eclipse).
Just changed and saved java file to recompile the class. Then error disappeared.
I was try run
Project->Clean...
And Rebuild. My problem was resolved
For linux (Debia) and working on Spring boot project (maven):
$ sudo mvn clean
Then open Eclipse and File -> Refresh.
I had same issue, it is something similar but this post didn't help in my case. I have many inner classes which is causing the compiler to create class names with all inner class names together that is creating class name more than 255 character file limit on NTFS! read it in some other blog. I thought it will be helpful to post here.
Ex : classA$InnerClassB$......InncerClassZ.class in target folder it won't generate the class if it exceeds this limit. Try renaming your inner class name shortened. In my case i have to add InnerclassZ as its exceeding its not generating class and Eclipse complaining.
A class file was not written. The project may be inconsistent, if so try refreshing....
I shortened InnerClassZ to IClassZ fixed the issue.
I had the same issue and it got fixed by running eclipse in administrator mode
Eclipse Shortcut-->Right click-->More-->Run as Administrator
I've been throught that error once when I used wsdl2java to extract java classes from a wsdl, it turns out that all classes were created in the same "class", causing end classes with long names (error - File name too long). When I organized and rename some classes the error disappeared.
I had this issue. I did the following, it resolved.
Open Eclipse in Administrator mode; Right click on eclipse.exe "Run as administrator"
Clean all projects.
#Denny's answer put me on the right track, though in my case it was the target directory. I deleted it for some reason and something automatically recreated with owner root. Changing the directory owner was not enough as it contained files that were also owned by root. So make sure to really remove the complete content of the directory and to change the owner.
In my case current user didn't have access to this project dir
Before giving a try to the above solutions. Just cleaned the project and it worked.

PyDev: "Unresolved import nltk" When running, pydev imports it

I want to get rid of this error message and I want to have the benefits of auto completion and suggestions. PyDev obviously does find nltk, because when running it from inside the IDE it works. Not only from console.
Surely someone needs to know why I got this "unresolved import" error message but on the other way when clicking on "run" it works perfectly well.
#TheGT seems to be on the correct path, though I found the instructions a little confusing. My solution:
Project->Properties->PYDEV-PYTHONPATH->External Libraries
Add source folder (button)
/Library/Python/2.7/site-packages/nltk-2-0/4-py2.7.egg
Obviously, your path, version, etc... could be different.
Here's what seems odd.
There's a button to add zip/jar/egg and that doesn't want to work correctly with the nltk...directory...egg. The nltk egg behaves like a directory in the chooser (i.e. continues to drill down rather than return).
On the other hand, the source folder button does allow you to choose a folder... so I chose the egg and that seems to work.
It seems like the nltk egg is not configured correctly for OSX. And, depending on how it is accessed, it can behave like a folder or a final destination.
NOTE: Adding the nltk egg into the external libraries path of your project makes the error go away. But adding the egg into preferences>PyDev>Interpreter does not appear to resolve the problem (on it's own).
I faced the exact same error when I was trying to use nltk in my project. I did 2 things to resolve the unresolved error to go away.
I added the setupctools**.egg file (the file that is used to install nltk in mac/*nix systems) as an external library
[Project->Properties->PYDEV-PYTHONPATH->External Libraries]
I am using Eclipse Indigo, and Python 2.6.1 on my mac btw.
I restarted the eclipse
Bam! - the error goes away.
Although, the error is not there anymore, I would like to know why Eclipse was behaving this way. The strange thing to note was that when I tried to run the program, the program did run successfully, even though eclipse marked "import nltk" as unresolved import.

Problems using netbeans 7.01 with CMake 2.8.6

so once again, I'm having a little problem I can't figure out myself. Meaning, I'm pretty sure I know what the problem is, I just can't fix it.
I'm developing in C++ using Netbeans 7.01 with CMake 2.8.6. However, when I'm trying to build a project, I get the following error from CMake:
CMake Error: The path to the source directory:
H:/Projects/Netbeans/CppApplication_1/CONF=Release
contains unsupported character '='.
Please use a different source directory name.
Please note, that "CONF=Release" isn't a folder. It seems to be a configuration flag set by Netbeans, as it changes when I'm trying a debug build. So, my guess here is, that theres a space missing, or something similar. Unfortunately, I can't figure out where to change that. There are no options in any related Netbeans window, I can't find anything related in the configuration files for netbeans itself or the project either.
Did anyone here have experienced the same problem and found a solution to it? I would be very glad to hear it. If there's any information missing, let me know, I will add them as fast as possible.
Edit:
Just noticed there is already version 7.1 of netbeans, nice to know. However, even with this version, the same problem occurs.
You must specify the command you ran to allow for the error to be identified. However, it looks like you missed the "source-path" parameter.
The cmake command ends with the path to source and should be something like:
cmake -D CONF=Release <path to source>

How can I fix this Android SDK build problem in Eclipse?

I am using Eclipse for Android dev and everything was going fine until I tried to incorporate the facebook SDK. Now when I tried to back it out, there appears to be an artifact left behind that Eclipse tries to link the FB library?!?
[2010-11-17 18:50:22 - Library Project] Unable to set linked path var '_android_com.facebook.android' for library /Users/mobibob/Projects/workspace/facebook-android-sdk/facebook: Path variable name cannot contain character: ..
Any clue where this command / reference is in the build configuration? I have scoured it as best that I can, but I still get the same error.
Problem solved ... as it turns out, it was not so much the Facebook SDK but something that I did in the process of configuring the library reference. I am not entirely certain of how I misconfigured, but I was tweaking the various "path" settings such that, once when the automatic build tried to build my project, an import for android.R was added to my source module. This superseded com.myproject.R and would not resolve the values for resource references.
There were other problems with path order and setting that I modified during the troubleshooting that made it worse. Recreating the project without Facebook was the first step to discovery and fixing.
Either way, the lesson I learned is that the build error messages can misdirect one to the configuration when the problem is in the source code.