I want to use pyomo to formulate MILP problems in python such as Green Vehicle Routing Problem and others but use metaheuristics algorithms (GA, Harmony search, etc.) to solve those problems instead of using pyomo solvers, its part of my PhD project and can not use derivative-based solvers such as Gurobi and cplex etc. at all; If the answer that I can not, what is the alternative to formulate the problems in python then solve them with metaheuristics algorithms because I found pyomo easy and time saving to be used in formulating the problems.
I think what you want is a meta-heuristic you can use without relying on all the work necessary to code one from the ground. If this is the case, I would recommend you to use the Biased Random Key Genetic Algorithm (BRKGA). Suffices to have in mind the basic notations of Genetic Algorithms, specifically the notion of chromosome and decode function, and there we go. In the section 8.5 of this paper, you can find a decode function applied for a G-VRP variant.
If you are interested to write the problem as a standard formulation, like mixed-integer linear programming, you can use Pyomo as a framework and solve the problem in an exact manner with your favorite solver.
About the (meta)heuristic, it is somewhat different from the exact method. In this case either you should already write your own algorithm or use some package/libraries to do it. Also, the flowing package and thread might be helpful.
Another option is to solve your problem with a hybrid approach, a math-heuristic. For example, you could use a metaheuristic to define some of the variables (maybe, the integer ones) and then solve the parametrized problem using MILP solver. For example, several ideas can be found here, here, here, here, and here.