Let $\pi: E \to B$ be a fiber bundle of (topological or differentiable) manifolds. Denote by $[B, E]\_{\pi}$ the set of all homotopy classes of sections of the bundle, i.e


\begin{align}
[B, E]\_\pi &= \{\sigma: B \to E \ | \ \pi\sigma = \text{id}\_B \}/\sim \\
\sigma \sim \sigma' &\iff \exists H: I \times B \to E \ | \ H\_0 = \sigma, H\_1 = \sigma', \pi H\_t = \text{id}\_B
\end{align}


Is it known how to calculate such set? With "calculate" I mean to reduce the computation of it to the computation of something more known, as the homology/cohomology/homotopy groups of $E$, $B$ or some combination of them.



Set of all sections of a fiber bundle up to homotopy equivalence
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**](http://dx.doi.org/10.1017/S0305004101005606), Math. Proc. Camb. Philos. Soc. 132, No. 2, 281-300 (2002). [ZBL0994.57024](https://zbmath.org/?q=an:0994.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}
$$


