(This is a fairly basic question, not really research level, except that I am a research mathematician working on other things who is trying to understand more topology for use in my own work.)


Let $\Sigma$ be a smooth, connected, compact 2d manifold, henceforth simple a "surface". We don't assume anything more (not necessarily closed or oriented).


$\Sigma$ has a tangent bundle $T\Sigma$, to which we can associate the "unit sphere bundle" $\mathbf{S}=\mathbf{S}(T\Sigma)$.


There is a map $\Sigma \rightarrow BS^{1}$ classifying this circle bundle, and so a class $c\_{1}(\mathbf{S}) \in H^{2}(\Sigma,\mathbf{Z})$, which is the obstruction to trivialising/finding a section of $\mathbf{S}$.


However, if $\Sigma$ is not closed, or not orientable, then $H^{2}(\Sigma,\mathbf{Z})=0$, so the circle bundle $\mathbf{S}$ should admit a section, and hence there should be a nowhere vanishing section of $T\Sigma$, that is a nowhere vanishing vector field on $\Sigma$.


But doesn't that contradict the Poincar'e-Hopf index theorem, saying that the Euler characteristic should be the sum of the indices of zeroes of the vector field? For example, $\mathbf{RP}^{2}$ has Euler characteristic $1$, but the above argument seems to show that there is a nowhere vanishing vector field on $\mathbf{RP}^{2}$ (which I don't believe).


So what gives?



Meaning of the first Chern class of the unit tangent bundle of a surface
The Poincaré-Hopf holds for non-orientable manifolds also. For a closed non-orientable surface $\Sigma$ the structure group of the sphere tangent bundle does not reduce to $SO(2)=S^1$, so it's classified by a map $\Sigma\to BO(2)$ rather than a map $\Sigma\to BS^1$. The obstruction to finding a section of the sphere tangent bundle is an element of $H^2(\Sigma; \mathbb{Z}^{w\_1})$, the cohomology with coefficients in the local system of integers twisted by the first Stiefel-Whitney class $w\_1:\pi\_1(\Sigma)\to \mathbb{Z}/2\cong \operatorname{Aut}(\mathbb{Z})$. By Poincaré duality with local coefficients, this group is isomorphic to $H\_0(\Sigma;\mathbb{Z})\cong\mathbb{Z}$.


In the case of manifolds with boundary, the statement of Poincaré-Hopf has to be modified to include some boundary conditions, such as that the vector field points outwards on the boundary. Think of a disk $D^2$, which has Euler characteristic $1$. It admits a nowhere zero vector field; but it does not admit one that points outward on the boundary.


