Issue
I have been through the various Stack Overflow questions and non of the answers resolve the issue for me. It is likely a path 'thing' that I am not seeing.
Have installed pandas
, it says its there, but numpy
will import and pandas
won't.
Any ideas? What am I missing?
If I enter:
!pip3 install pandas
I get:
Requirement already satisfied: pandas in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (1.0.3)
Requirement already satisfied: pytz>=2017.2 in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (from pandas) (2020.1)
Requirement already satisfied: numpy>=1.13.3 in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (from pandas) (1.18.4)
Requirement already satisfied: python-dateutil>=2.6.1 in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (from pandas) (2.8.1)
Requirement already satisfied: six>=1.5 in c:\users\ron mcmillan\appdata\local\programs\python\python38\lib\site-packages (from python-dateutil>=2.6.1->pandas) (1.14.0)
Solution
Okay, I'm going to give a completely new, opinionated, answer.
It looks like you've got at least two installations of Python, one in ..python\python38
, and one in ..\python\python38-32
. pandas
is installed on the first, but jupyter
is running on the second. You've got a version of pip
for each, plus a third one in Microsoft\WindowsApps
.
On Windows, you are probably safe to just uninstall all the versions of Python on your computer. Then download Miniconda for Windows. Miniconda is, like pip
, a package manager for Python; but unlike pip, is able to also install non-Python files, which makes all sorts of things much easier. It's called 'Miniconda' to distinguish it from 'Anaconda', which is conda
plus almost all the packages a data scientist might need -- Miniconda just gives you the package manager conda
, and you can then choose to install what you actually want.
Once conda
is installed, create a new conda environment (conda create -n MYNEWENV
-- if you have twenty minutes then read the quickstart explanation) and then try to download everything with conda install...
You can specify which 'channel' you download packages from, but you probably don't need to. Just try conda install jupyter numpy pandas
; or search the Conda cloud for the specifics of whatever you want.
Answered By - Peter Prescott
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.