when i initially ran
$ pip install pandas
it gave me an error that i don't have permissions. then when i tried
$ sudo pip install pandas
it gave me this -
fatal error: Python.h: No such file or directory
After some search, i came across this command
$ sudo pip install -U pandas
after a very, very verbose output, it gave the same error but this time it prompted me that i might need/want to install python-dev & python-setuptools after installing python-dev, pip install pandas worked fine and without a hitch!
So, my question is, does anyone know why this problem occurred?! Has this occurred before?! and what does the -U in $ pip install -U ... stand for?! it isn't mentioned in the help page for pip, i checked!
Also, i know that there's a log file for at /home/user/.pip/pip.log but instead of appending error messages to the log file, it gets rewritten each time there's pip runs into a problem.
Is there anyway to fix this?! Also, can i make pip log every install as well and not just the ones that went wrong! instead of having to do
$ pip install ... >> LOG_FILE
everytime!
EDIT 1 : turns out i didn't do enough research, i found that Python.h isn't necessarily installed by default though i have them installed.
But i'd still like to know what the -U stands for and how to keep a log file in pip.
In most cases this error in Python generally raised: You haven't installed Pandas explicitly with pip install pandas. You may have different Python versions on your computer and Pandas is not installed for the particular version you're using.
You always need the python-dev
package to compile Python C extensions such as the ones in Pandas. When you install Python from source, they're installed along, but not with the Ubuntu package.
From pip install --help
:
-U, --upgrade Upgrade all packages to the newest available version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With