Newly created Pydev Django Project does not include initial package with Settings.py etc - django

When creating Django Pydev projects in Eclipse the default config package is created automatically with the following structure:
MyApp
__init__.py
settings.py
urls.py
wsgi.py
manage.py
Today I created a Django Pydev project and those files and initial package were not created.
I have tried several times to create new Django Pydev projects but the the initial structure is not being created.
This problem only just started happening. I have not had the problem prior to today.
Running this on the command line does work:
django-admin.py startproject mysite
The files and project structure are created correctly. So it's just Eclipse and Pydev that fails.
I am using Django 1.4, Pydev 2.5 and Eclipse Indigo 3.7 on Ubuntu 11.1

I had the same issue today but it turned out that it was because my project name was not handled - eg "My Project". The space threw it. Calling the project "MyProject" worked a treat.
From the cmd line it gives the following error - which eclipse is not returning:
c:\django-admin.py startproject "My Project"
Error: "My Project" is not a valid project name. Please use only numbers, letters and underscores.

I ran into the same issue on win7.
I also tried to run django-admin.py manually from command line. Instead of generating a project, it opened up a default editor for .py file. Then this was clear to me that it was because I installed some program which registered itself as the default program to run .py file. In my case it was WebMatrix2 but even if you don't install anything, there is a good chance that it is set to notepad by default by win7.
I knew that PyDev will actually run django-admin.py to generate the project. So my guess was that PyDev tried to run the .py file. Then since the program to run it was not python.exe, nothing was generated. PyDev ignored this error so there was nothing in the project.
Then the fix is simple. Choose any .py file, right click to open the properties window and change the default program to python.exe.
Now go back to Eclipse and try to create a django project again. You should be able to see manage.py file and other files created.
Hope this helps.

I was having this problem - I tried to create a project called test-django, and it wouldn't add manage.py etc to the structure. So I tried doing the same thing with django-admin.py and it failed and said only numbers, letters and underscores!
So the problem is that eclipse/pydev fail to report this error and make the project anyway!

I had a similar issue today (Win7). I had been using eclipse, PyDev and Django for a while and had no problems. Tried to create a new project today, and it failed to populate the project folder with manage.py etc.
I happen to have both Python 32 and 64 bit installed, but Django 32 bit. I forgot to select the 32 bit interpreter when I created the project, and so it called the 64 bit interpreter to run django-admin.py and failed silently. Once I selected the 32 bit interpreter it created the project folders as expected.

Met the same issue when creating a PyDev Django project in the virtual environment.
Unable to find out any effective solution either in Chinese or English. After a few tries, I've managed to resolve it
When creating the PyDev Django Project, instead of putting your project folder in the virtual environment folder, you need to choose another directory outside.
Eclipse Pydev Screenshot
I tend to believe this is a PyDev bug, as I can put my django project folder anywhere using the command:
django-admin startproject PROJECT_NAME.
It works fine in the virtual environment folder. Refer to my setup environment below:
Eclipse Oxygen: 4.7.1a
PyDev : 6.1.0.201711051306
Django : 1.11.7

Just to note, provided you have the latest PyDev, this should work (previous versions had issues with Django 1.4) -- it's possible that it's just missing a refresh (i.e.: it's creating it but not showing in the PyDev package explorer).
Just refresh it and see if it works -- and make sure you have 'refresh using native hooks' and 'refresh on access' selected on window > preferences > workspace.
If you still have an issue, please check if they really weren't created in the filesystem and if they weren't check your error log for some error there and report back.

Had the same issue.
Fixed by doing Help -> Check for Updates.
Updated Eclipse and restarted.

i met this issue, too.
However, after devastatingly searching online. I'd decided to re-install the plugin with a brand new Eclipse for Java EE Developer, Version: Indigo (previous was Classical Eclipse, Indigo).
And it worked!

I know this question was asked long time ago, but I faced the same problem with Eclipse Neon and I figured out possibly there is a bug.
I guess you used File>New>PyDev Project to create a project. I used MyProject as the name of the project so I did not have any space in the name, and therefore project name could not be the issue. You should see 3 steps to configure your project, while the 3rd one is not shown. The 3rd step is Django Setting and if you cannot get to that step, your files will not be created.
Instead if you use CTRL+N, you will see a different wizard and this way it takes you to 3rd step and all the file will be generated.

Related

unable to uninstall netbeans 8.0.2

Error message showing is :
The specified target component - nb-base/8.0.1.0.201408251540 was not
found in the registry. The installer can continue as if the target
component was specified. Click yes to continue, No to exit the
installer.
I have tried a lot to uninstall my NetBeans8.0.2 but were unable. After lot of googling found out a solution. I think I should have and entry in stackoverflow.
Best way to remove Netbeans can be done using following steps
Remove the Netbeans folder from program file
Delete the .nbi(hidden) folder from your C:\User{Current User}
Go to control panel and remove it
It works for me hope it will you too!
Actually Devashish's answer is (partly) correct. If you click link provided by him, you will see that the problem (most likely) is because the install was done by a different user than the user who is uninstalling. (In my case, I added an admin user after the Netbeans install, so all computer changes now pass through the admin user)
Here is what I did to complete the install:
Find a .nbi folder under C:\Users\folder. This folder has .nbi folder under it
Open a command prompt and Go to NetBeans folder which has uninstall.exe
Run this command in the command prompt:
uninstall.exe --userdir c:\Users\folder\\.nbi
folder is the folder you found in step 1.
This uninstalled for me. Hope it helps you.
Go to C:\Users{User}\AppData\Roaming\NetBeans
Delete "lock" file
Uninstall NetBeans
Please follow the link to have a solution:
https://netbeans.org/bugzilla/show_bug.cgi?id=251943
The comment 5 has easiest solution:
Run Command Prompt in Administrator mode and run the following command :
uninstall.exe --userdir c:\Users\Administrator.nbi
Does not seem to work in my Win 10 environment. I've also tried
.\uninstall.exe --userdir c:\Users\Administrator\.nbi
.\uninstall.exe --userdir c:\Users\Administrator.nbi
'NetBeans 8.0.1'\uninstall.exe --userdir c:\Users\eric_2\.nbi
.\'NetBeans 8.0.1'\uninstall.exe --userdir c:\Users\eric_2\.nbi
.\'NetBeans 8.0.1'\uninstall.exe --userdir c:\Users\eric_2.nbi
You get the point. I'm running the WindowsPowerShell as an Administrator.
Someone here must have successfully deleted it even with the error message from the OP. I just have to find out who!
Eric
After struggling here and there, I:
Opened c:\Users\XXX\AppData\Roaming\NetBeans\8.2\lock where XXX was the user name. Then, I renamed lock. (The name didn't matter.)
Then, I went back and uninstalled NetBeans.
By the way, I had to delete Java separately.
I was having the exact same problem as above.
Prior to the "symptoms", I installed the application in a newly created folder on the C drive (Not the Program Files default installation directory).
I then changed the name of the folder directory where the executable was installed to enable a third-party script to launch the NetBeans executable as the script required no spaces in the path. In any case, in attempting to uninstall the application again, I got the above error.
I tried running the command as outlined above (namely) running the command prompt with the following:
C:\Netbeans\NetBeans 8.0.2>uninstall.exe --userdir C:\Users\mark.burl.nbi
it launched the uninstall but the same error popped up.
I then undertook the following and the problem was solved for me:
I manually deleted the NetBeans executable folder.
I then reinstalled NetBeans to the default Program Files location.
I then uninstalled NetBeans again no problem.
From PowerShell as administrator I removed all directories here described and finally enter regedit and search for all occurrences of “NetBeans (x86)”. And delete all of them then restart and after that everything is clear
You need to do the following:
Go to C:\Users{User}\AppData\Roaming\NetBeans
Delete the folder named after your Netbean version you want to uninstall
Uninstall NetBeans
Finally i found the reason. i.e while installing NetBeans i used our IT Team Admin credentials (assume user-1 ). But i am uninstalling with my credentials(assume user-2).
So, you can't uninstall. Follow below steps.
1.Go to C:\Program Files\NetBeans 8.0.1> you will find uninstall.exe file.
2.Find who is installed your netbeans for me user-1 (Admin).(You can find all users here C:\Users )
3.Then search for .nbi folder you can get at C:\Users\{user-1}\.nbi
Note: here user-1 is who installed your NetBeans initially.
finally open cmd prompt and run the command below given.
C:\Program Files\NetBeans 8.0.1>uninstall.exe --userdir C:\Users\{user-1}\.nbi
referred from https://stackoverflow.com/a/45387962/10971996
I had the same problem and no matter how hard I tried it won't uninstall until I installed it all over again then uninstalled.
Stop/ pause protection for your anti-virus. Then click on un-install. It will work for sure.

Pycharm debugger does not stop on breakpoints

I have a flask project I am trying to debug (this was working absolutely ok till few hours ago) - When I debug the project, I see the following :
Connected to pydev debugger (build 135.1057)
/Users/vantani/cp/bin/python /Applications/PyCharm.app/helpers/pydev/pydevd.py --multiproc --save-
signatures --client 127.0.0.1 --port 49223 --file /Users/vantani/cp/unnamed/manage.py server
pydev debugger: process 484 is connecting
/Users/vantani/cp/lib/python2.7/site-packages/flask_cache/__init__.py:152: UserWarning: Flask-
Cache: CACHE_TYPE is set to null, caching is effectively disabled.
warnings.warn("Flask-Cache: CACHE_TYPE is set to null, "
* Running on http://127.0.0.1:5000/
* Restarting with reloader
pydev debugger: process 498 is connecting
As I said this setup was working fine. Now, the debugger does not stop at the breakpoint and the debugger window is empty. I see that there are two processes created by PyDev and I guess that is causing this issue. I have restarted my machine and there is only one pycharm process running.
Sometimes this might be caused by the fact that some other module is using the same tracing api (sys.settrace) as debugger, for instance Coverage.py. The solution would be to go to your Rub/Debug Configurations and add --no-cov flag to the Additional Arguments.
Alternatively you might want to delete all --cov in pytest settings (i.e. pytest.ini) or run tests with --no-cov flag, i.e.
pytest test.py --no-cov
It might be also caused by a bad filename, e.g. your file/directory has special characters or spaces in it. Try removing them or changing to e.g. underscore (_).
There is an issue with the debugger in PyCharm lately.
I'm on mac using PyCharm 2020.2 and while the debugger would stop at tests, it wouldn't stop when running the dev server for django.
For me disabling Gevent compatible option in Preferences > Build, Execution, Deployment has helped.
Worth noting that some suggest to enable some suggest to disable that option - so it's worth having a go at each and see if that helps your case.
Just need set flask's debug mode off, such as
app.run(debug=False)
I didn't have a flask project but I had the same problem. In my case I had to change the project-path! There were umlauts (ü,ä,ö) in it. By removing them the breakpoints worked again.
My problem is solved when I installed pydevd-pycharm
pip install pydevd-pycharm
Also here is a useful link for this problem.
github from jetbrains intellij-community
Check your python debugger settings, and clear your cache, This helped me
The following workaround should help. I had a same problem in a simple Python script. PyCharm debugger didn't stop on a simple breakpoint and just ran to the end.
Thanks to Gabriel's answer, I checked the path to my script and it had Russian letters. Because I use Russian Windows and it creates admin user named 'Administrator' using Russian letters.
I changed the Russian letters to use only English letters from the project-path (just copied PyCharm projects folder to the root of disk and reloaded my project from new place. Nothing else was changed!). And the debugger immediately started working just fine and stopped on breakpoints!
It looks like this a bug that PyCharm debuger can't work with different national letters in the path. It very common situation outside English-speaking countries.
For Sanic case.
Run go_fast(..auto_reload=False,..).
There is a long thread about this issue on JetBrains forums:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360008107400-PyCharm-2020-1-not-stopping-on-breakpoints-anymore-. Reading through that thread is like reading a black magic book, everyone has their own voodoo $^$#
I ran into this issue with 2021.1.1 CE and a brand new project. My solution was to change the default test runner to pytest. YMMV. If that thread is any indication, debugging might stop working if it rains tomorrow.
For me I deleted project from "recent projects in pycharm" then I opened project direct from repository. It works again.
Had the same issue recently (July 2021 PyCharms 2021.1.3 CE) for days trying everything I could find online would not work. Then found under File --> Manage IDE Settings --> Restore Default Setting, that fixed the issue for me.
For all those people that have the same problem, but can't resolve it, maybe this will work:
The problem could be, that pydev isn't connecting to its subprocess.
Check if the option "Attach to subprocess automatically while debugging?" in the debugger settings is set. You can find it in File > Settings > Build, Execution, Deployment > Python Debugger (current version of PyCharm)
Usually there is also a short hint in the console but I didn't notice it.
After removing debug_toolbar middleware the debugger is back to normal.
It's happening because of a third party module. I tried all the solutions listed and none worked for me.
I changed the interpreter that I'm using and it's working.
I had this issue when running remote interpreter from docker-compose. It disappeared when I set Working directory to my project root directory in Run/Debug Configuration. I also restarted Pycharm and invalidated caches.
I got it fixed by removing coverage config from pytest.ini
Not exactly the same case but, if you are using the Debug Server to debug a docker container, the only thing which made the breakpoint to stop for me is to set and environment variable for the container:
PYCHARM_DEBUG=True
PyCharm Version: 2022.2.2
For me PyCharm actually executed a different file. If you just clicked the run button... try if it makes a difference if you use
right click on file => Run 'xy'.
Or double check if your file full path to be executed is specified in "Script path" in the run configuration. I used to use the file name in "interpreter option" along with "working directory" specified. It would work that way.

"Launch failed. Binary not found." error on CDT Kepler Eclipse

Running or debugging anything gives me an extremely frustrating "Launch failed. Binary not found" error. I'm using Eclipse with a CDT plugin installed (specifically, I have the MinGW package installed).
I already tried setting both the user and system PATH variables to include my (MinGW directory)/bin
I also tried building the program before running it.
I also made sure that PE Windows Parser under the project's settings was enabled.
I went to Project Properties > Run/Debug Settings > New > C/C++ Application > Environment > Select > and I selected the Path
I also tried setting the C/C++ Application in the Main tab to the executable file that is made from building the program, but no such file is made when I do build my program. I seriously doubt that this is what's causing the problem, though.
I'm running out of options, and the problem still persists. What else needs to be done? What am I doing wrong?
When I was looking through the install instructions for MinGW, the tutorial referenced the mingw base package as the package to install after installing MinGW. But mingw base was not available to me. Instead, I saw mingw32 base. Could it be that Eclipse, a 64 bit program, is trying to run 32 bit code? Is that what's going on? If that's the problem, how do I fix it?
Build
Refresh the project. A new folder named Binaries will appear now in project explorer.
Now Run :)
It took me 3 days to figure out my problem. My Hello World C program would compile in eclipse using the Windows PE Parser, but there was NO EXE FILE!!!! AVAST Antivirus was identifying the exe file as a false positive and removing it....grrrrr. The solution was to add the eclipse workspace folder to the exclusions list. Voila!! Eclipse generated my test.exe file.
save the file first before you build and run... it works with me
Check the compiler you set while you created the project . If that is MINGW or Visual Studio ; check whether they are downloaded or not . If not do so and start a new project by closing the old one . Build the new project by pressing Ctrl + B and a new file 'Binaries' is created in the package explorer . Now you can use the run option to run the project .
First the solution: install "make"
I had the same issue.
I also tried the steps you did with no luck.
After some time i found a the solution!
The problem was that i did not have the application "make".
Apparently its not installed by default on Cygwin and eclipse doesn't give any indication for that...

Django autocomplete in Eclipse

I want to use the autocomplete of PyDev with Django in Eclipse. I've followed these two threads
Autocompletion in Django + pydev
PyDev and Django: Autocomplete not detecting Django?
so I went to
Windows -> Preferences -> PyDev -> Interpreters -> Python Interpreter
selected the libraries tab and added path\to\Django\Django-1.6.1\django
and then right-clicked on Project's name then Preferences -> PyDev - PYTHONPATH
clicked on the external libraries and added the project folder and
C:\Python27\Lib\site-packages
finally I went to
Window->Preferences->PyDev->Editor->Code Completion
and checked that the autocomplete was on and it was so. But still don't have the auto-complete on. But it doesn't even autocomplete the variables that I have defined in the same class. Could anyone help me on this?
I fixed this myself. The problem wasn't related to PYTHONPATH or anything like that I had said above. The problem was with Aptana! I also noticed that Aptana that is now available for Windows x86 was 3.4.2 rather than 3.5 that was installed before. I think they had noticed that there are bugs in 3.5 and are now providing the 3.4.2 version.
To fix this simply reinstall Aptana.
Note: if you are getting "Port not bound (found port -1). Is there an enabled firewall?" after you enter some text and try [Ctrl + Space] you likely have the same problem.
Hope that helps for you.

Eclipse/PyDev + Django debug

Eclipse/PyDev, Python 2.6, Django 1.1
All is working in run mode. If I put debug point inside manage.py file, breakpoint worked. But when I putted it in any action method, it causes nothing :(
Usually the problem is that you're running with auto-reload in django, in which case a different process is actually feeding the pages, so, you need to run it with the no reload option or use the remote debugger.
(To configure PyDev to work with Django see: http://pydev.org/manual_adv_django.html)
Note that if you want to execute without the auto-reload feature (which PyDev should do automatically when you create a new Django run), you can do all directly (i.e.: the debugger and launching don't need any special adjustments).
Note: the situation has improved a bit recently, so, although the above answer is still valid, there are improvements for those that do want to develop with auto-reload on:
Answer with auto-reload on:
If you want to have auto-reload on while developing, use the tips at: PyDev and Django: how to restart dev server? (to overcome an issue where Django will leave child processes alive when the main process is killed)
And see the session related to the remote debugger at: http://pydev.org/manual_adv_remote_debugger.html to see how to attach the debugger to PyDev when using the auto-reload feature (mainly, you'll need to start the remote debugger, but will add breakpoints regularly and PyDev will stop on those provided you call pydevd.patch_django_autoreload() before you main session -- i.e.: before if __name__ == "__main__":, add the following: import pydevd;pydevd.patch_django_autoreload()).
also if while attempting to import pydevd eclipse can't find the pydevd depependency. Make sure to add it from your plugins folder:
Look for your eclipse/plugins/org.python.pydev_x.x.x/pysrc where x.x.x is your eclipse pydev plugin version. In the eclipse/plugins folder you will find lot's of folders that start with a similar name only one of them will have a pysrc subfolder(and the right version number).
Add eclipse/plugins/org.python.pydev_x.x.x/pysrc to your project's external libraries:
Right click on your project explorer.
Go to properties/PyDev - PYTHONPATH/External Libraries/ and click on Add Source folder.
Find your eclipse/plugins/org.python.pydev_x.x.x/pysrc folder on the provided browser.