Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sort projects alphabetically by name in PyDev Package Explorer in Eclipse?

In addition is there any universal way of doing this which works for other types of projects (in other perspectives) as well?

like image 828
Piotr Dobrogost Avatar asked Jun 23 '11 12:06

Piotr Dobrogost


People also ask

How do I sort package explorer in eclipse?

Package Explorer > View menu (the triangle) > Configure Working Sets... There you can configure the ordering or choose auto-sorting.

How to sort projects in Eclipse?

There is a Sort menu when you click on the arrow on the top left of the view, you can select sort by name or sort by type.

How do I group a project in Eclipse?

But you can group Projects into named Working Sets. On the Package Explorer or Project Explorer view menu, you can use Top Level Elements -> Working Sets and use Configure Working Sets.../Select Working Sets... to organize your Projects into folder-like groups.

How do I open PyDev Package Explorer?

To switch to PyDev, if it isn't already selected, choose Window > Perspective > Open Perspective > Other > PyDev. Then, select the PyDev Package Explorer view by choosing Window > Show View > PyDev Package Explorer to see and access the contents of each project directory.


2 Answers

I was experiencing this (very annoying) problem, and I found a post by somebody on SourceForge having the same problem who said he discovered that if he added the project's root folder to its PYTHONPATH, it cleared up the problem. So I looked at my mis-alphabetized project's PYTHONPATH and saw that it already included the root folder in addition to the src folder. So just on a whim, I removed the root folder from PYTHONPATH. (I really should not have had it there anyway.) And although that was the opposite of what he said fixed his problem, it fixed my problem. Go figure.

like image 67
Alan Avatar answered Oct 28 '22 01:10

Alan


The following worked for me:

  1. Add the project root to the projects PYTHONPATH
  2. Right click on project > Close Project
  3. Right click on project > Open Project

The problem projects then magically appeared in the right order.

like image 37
Alan Gibson Avatar answered Oct 28 '22 01:10

Alan Gibson