The relevant (simple) obstruction theory mentioned in the comments is contained in G. W. Whitehead's Elements of Homotopy Theory, Section VI.6. There an answer to the more general lifting problem is obtained under certain conditions, one of which is that the fibre $F$ is $q$-simple for certain values of $q$ (meaning $\pi_1(F)$ acts trivially on $\pi_q(F)$). The answer is then given in terms of cohomology with local coefficients.
In the non-simple case, you might check the papers of P. Olum (or the work of H. J. Baues citeed in the comments), but the answer is likely to be complicated.
However, you mentioned in the comments that you are interested in the case of the projectivized tangent bundle
$$
\mathbb{R}P^{n-1} \to PTS^n \to S^n
$$
of the $n$-sphere. A section of this bundle is also known as a line field on $S^n$. It is well known that there exists a line field on a closed manifold $N$ if and only if the Euler characteristic $\chi(N)$ is zero (this is proved as Theorem 2.3 in https://arxiv.org/abs/1612.04073, for example). Hence there exist line fields on $S^n$ if and only if $n$ is odd.
In the case $n$ odd, the fibre $\mathbb{R}P^{n-1}$ is not $(n-1)$-simple (the acion of $\pi_1(\mathbb{R}P^{n-1})=\mathbb{Z}/2$ on $\pi_{n-1}(\mathbb{R}P^{n-1})=\mathbb{Z}$ is non-trivial) so the standard obstruction theory does not apply to classify the sections. However, the more general problem of classifying line fields on a closed $n$-manifold $N$ up to homotopy, i.e. classifying sections of the projectivized tangent bundle
$$
\mathbb{R}P^{n-1} \to PTN \to N
$$
up to vertical homotopy, has been attacked by Koschorke in
Koschorke, Ulrich, Homotopy classification of line fields and of Lorentz metrics on closed manifolds, Math. Proc. Camb. Philos. Soc. 132, No. 2, 281-300 (2002). ZBL0994.57024.
There it is claimed (in Example 1.7) that the number of line fields on $S^n$ up to homotopy is given by
$$
\ell(S^n) = \begin{cases} 0 & n\mbox{ even}\\
1 & n\equiv 1(4)\\
2 & n\equiv 3(4), n\ge7\\
\infty & n=3. \end{cases}
$$