Is my attempt at an alternative derivation of electron degeneracy pressure correct? I am aware that one can derive the electron degeneracy pressure from the total energy of a gas of electrons, given by
$$ E_{tot} = \frac{\hbar^2(3\pi^2N)^{5/3}}{10\pi^2m}V^{-2/3}. $$
Where $N$ is the number of particles in the gas and $V$ is its volume. I can then calculate the degeneracy pressure using $ P = -\frac{\partial E_{tot}}{\partial V}$, but I would like to go via the partition function.
The partition function in the canonical ensemble is given by $Z = \sum_i g_ie^{-\beta E_i} $ where $g_i$ is the density of states. For a free electron gas this is given by 
$$ g(E)dE =  \frac{V}{2\pi^2}\bigg(\frac{2m}{\hbar^2}\bigg)E^{1/2}, $$
so my partition function should be given by an integral instead of a sum:
$$ Z = \int g(E)e^{-\beta E}dE = \frac{V}{2\pi^2}\bigg(\frac{2m}{\hbar^2}\bigg)\int E^{1/2} e^{-\beta E}dE. $$
I then hoped I could use the identities $ F = -kT\ln Z $ and $ P=-\frac{\partial F}{\partial V} $ to then get the pressure but I don't know how to evaluate the logarithm of $Z$. 
 A: Your current approach is just going to give you the ideal gas law as 
$$\ln Z = \ln V + \ln f(T)$$
where $f$ is some function that depends only on the temperature. In particular $f$ does not depend on $V$, so
\begin{align*}
P & = -\frac{\partial F}{\partial V}\\
& = k_BT\frac{\partial }{\partial V}\left(\ln V + \ln f(T)\right)\\
& = \frac{k_BT}{V}
\end{align*}
for a single particle.
The problem you are having is that you haven't said anything about the number of electrons in your system, which is a problem because the degeneracy pressure is ultimately caused by the exclusion principle and the presence of a large number of electrons.
In the canonical ensemble this is not a simple problem. Say I have only one electron. If I know that a particular state is occupied, then I immediately know that every other state is unoccupied. This means that the occupation numbers of the single particle states are entangled and I can't talk about the occupation of one state without dealing with all other states. If I add more electrons I get the same effect, only now you must make the total of your occupation numbers add up to $N$ rather than 1 and the combinatorics get much much worse.
The solution is to move to the grand canonical ensemble. Since the total number of particles is no longer fixed, the occupation numbers of the different single particle states no longer have to add up to any specific total and so they are decoupled giving us a much simpler problem. We then choose the chemical potential so that the average number of particles is correct. 
It might not seem very reasonable to use the grand canonical ensemble in some cases (I can't believe the number of neutrons in a neutron star changes very much) however if we are in the thermodynamic limit and at low temperature (which for a degenerate Fermi gas we presumably are) then we expect fluctuations to be small and results should not differ by much. 
