**NOTE:** The following proof is valid if one defines an “operator” as a linear function, _not necessarily assumed to be bounded_, between two vector spaces. I claim that if $X$ is as you described, then it must be finite-dimensional. To see this, suppose, for the sake of contradiction, that $X$ is infinite-dimensional. Then, the dimension of $X$ must be at least of the cardinality of the continuum. (See [here](http://math.stackexchange.com/questions/141535/cardinality-of-a-hamel-basis). In fact, one can use [Baire’s category theorem](https://en.wikipedia.org/wiki/Baire_category_theorem) to conclude that the dimension of $X$ must be uncountable, but the former result is stronger without assuming the continuum hypothesis. Why one needs the stronger result that $\operatorname{dim} X\geq\#\mathbb R$ will be clear below.) The dimension of $\ell^p$, on the other hand, is _precisely_ $\#\mathbb R$ for any $p\in(1,\infty)$. (After all, the cardinality of _all_ real sequences is $\#\mathbb R$.) Let’s take a Hamel basis $\mathscr H$ of $X$ and a Hamel basis $\mathscr L$ of $\ell^p$. By the preceding arguments, there exists a surjective function $f:\mathscr H\to\mathscr L$. Using the fact that basic representations are unique, one can extend $f$ to a surjective linear function $F:X\to\ell^p$. By assumption, $F$ is a compact operator, so it is _a fortiori_ continuous. Letting \begin{align*} U\equiv\{x\in X\,|\,\|x\|<1\},\\ C\equiv\{x\in X\,|\,\|x\|\leq 1\}, \end{align*} one has that $F(C)$ is precompact in $\ell^p$, so that $F(U)$ is also precompact. Invoking the [open-mapping theorem](https://en.wikipedia.org/wiki/Open_mapping_theorem_(functional_analysis)), one can conclude that $F(U)$ is a non-empty, precompact open set. But this is impossible, since $\ell^p$, being an infinite-dimensional normed vector space, cannot be locally compact.