Django 'Unresolved import' Error of Pydev in Ubuntu Fix
Recently I switched from Windows to Ubuntu and being a beginner I had to face a few problems setting up everything . For writing Django apps I use Aptana IDE that in turn uses the Pydev plugin. I downloaded the tar ball from aptana official site .Installed Django using the terminal. Extracted Aptana tar ball in home directory and Ran it by double clicking on 'AptanaStudio3'. Everything looked nice until I imported a django app in the workspace . All the Djano import when marked as error and they could not be resolved . There was nothing wrong with the Python path variable and when running the Project from the terminal everything worked .The Problem was with Aptana/Eclipse that it could not resolve the path. I found the reason after some time and this is how i solved it .
The problem:
The Reason:
The location /usr/local/lib/python2.7/dist-package/ is the place where python keeps all django files but this location has restricted permissions for the current user,and root has all the right so if Aptana is opened as root then this issue can be sorted out .
The Solution:
1.open the terminal (ctrl+Alt+T)
2. cd to the the directory where AptanaStudio3 is .
3. The in the terminal type
sudo ./AptanaStudio3
4.Type the password when asked for .
Thats it ,Problem solved now Aptana(pydev) shows no error.
The problem:
The Reason:
The location /usr/local/lib/python2.7/dist-package/ is the place where python keeps all django files but this location has restricted permissions for the current user,and root has all the right so if Aptana is opened as root then this issue can be sorted out .
The Solution:
1.open the terminal (ctrl+Alt+T)
2. cd to the the directory where AptanaStudio3 is .
3. The in the terminal type
sudo ./AptanaStudio3
4.Type the password when asked for .
Thats it ,Problem solved now Aptana(pydev) shows no error.
0 comments