Energetic materials (EMs) including explosives, propellants and pyrotechnics have been widely used for the military and many other purposes. Solid nitrobenzene (an organic molecular crystal) could be considered as a prototype of energetic material. Up to now, numerous studies have been devoted to crystal structures, spectrum properties and decomposition mechanisms for solid nitrobenzene experimentally and theoretically. However there has been a lack of the comprehensive understanding of the anisotropic characteristics under different loading conditions. Thus we investigate the hydrostatic and uniaxial compressions along three different lattice directions to determine this anisotropic effect. In this work, the density functional theory calculations are performed based on Cambridge Sequential Total Energy Package (CASTEP) code using normconserving pseudo potentials and a kinetic energy cutoff of 700 eV. The generalized gradient approximation with the Perdew-Burke-Ernzerhof parameterization is used. Monkhorst-Pack k-point meshes with a density of 0.05 -1 are used for Brillouin-zone integration. The empirical dispersion correction by Grimme is taken to account for week intermolecular interactions. The hydrostatic compressions are applied from 0 GPa to 20 GPa. Cell volume, lattice shape and coordinates of the atoms could be fully relaxed. while uniaxial compression is applied up to 70% of the equilibrium cell volume in steps of 2% along their lattice directions respectively. At each compression step, only atomic coordinates are allowed to relax, with the lattice fixed. The equilibrium lattice structures under hydrostatic compressions are obtained by full relaxation at 0 K temperature. In ambient condition, the calculated volume and parameter of the unit cell are underestimated compared with the experimental data, and corresponding errors are -2.98%, 0.01%, -4.39%, 5.71% respectively. In contrast, the calculated lattice energy is overestimated compared with the range of experimental results with 5.71% of the error. In high pressure condition, the volume and cell parameter of the unit cell as a function of compression ratio are plotted and compared with the experimental data. The theoretical and experimental values are close with the increase of the pressure, for instant, the error decreases from -4.39% at 0 GPa to -1.93% at 4 GPa. On the other hand, the uniaxial compression is applied along the directions of three lattice vectors. The changes of stress tensor, band gap, energy per atom as a function of compression ratio are also plotted and discussed, which can characterize the anisotropic effect of solid nitrobenzene. The most noticeable effect of anisotropy in solid nitrobenzene is the metallization at V/V0=0.76 compressed along the X axis, while the solid nitrobenzene under hydrostatic pressure or other uniaxial compressions up to V/V0=0.76 remains semiconductor with band gap larger than 1.591 eV. By analyzing the local density of states and charge density distribution of nitrobenzene crystal, we confirm that the metallization is caused by the overlap of the electron from benzene ring. Through calculating different physical parameters, we find that X axis is the most sensitive direction of nitrobenzene crystal. The studies of anisotropic effects are expected to shed light on the physical and chemical properties of solid nitrobenzene on an atomistic scale and provide several insights for experiments.