ImportError: No module named pandas

前端 未结 5 699
暖寄归人
暖寄归人 2020-12-04 14:03

I am trying to write a code in python to fetch twitter data i am not getting error for twython. But i am getting error for pandas.

I have installed pandas using pip

相关标签:
5条回答
  • 2020-12-04 14:30

    If you are running python version 3.9 pandas wont work as of now. So install python version 3.7 or below to mitigate this issue. Or else if you want to stick with python 3.9 try install pandas by compiling the library

    0 讨论(0)
  • 2020-12-04 14:36

    I fixed the same problem with the below commands... Type python on your terminal. If you see python version 2.x then run these two commands to install pandas:

    sudo python -m pip install wheel

    and

    sudo python -m pip install pandas

    Else if you see python version 3.x then run these two commands to install pandas:

    sudo python3 -m pip install wheel

    and

    sudo python3 -m pip install pandas

    Good Luck!

    0 讨论(0)
  • 2020-12-04 14:39

    When I try to build docker image zeppelin-highcharts, I find that the base image openjdk:8 also does not have pandas installed. I solved it with this steps.

    curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | python
    pip install pandas
    

    I refered what-is-the-official-preferred-way-to-install-pip-and-virtualenv-systemwide

    0 讨论(0)
  • 2020-12-04 14:42

    You're missing a few (not terribly clear) steps. Pandas is distributed through pip as a wheel, which means you need to do:

    pip install wheel
    pip install pandas
    

    You're probably going to run into other issues after this - it looks like you're installing on Windows which isn't the most friendly of targets for numpy/scipy/pandas. Alternatively, you could pickup a binary installer from here.

    You also had an error installing numpy. Like before, I recommend grabbing a binary installer for this, as it's not a simple process. However, you can resolve your current error by installing this package from Microsoft.

    While it's completely possible to get a perfect environment setup on Windows, I have found the quality-of-life for a Python dev is vastly improved by setting up a debian VM. Especially with the scientific packages, you will run into many cases like this.

    0 讨论(0)
  • 2020-12-04 14:47

    It might be too late to answer this but I just had the problem and I kept installing and uninstalling, it turns out the the problem happens when you're installing pandas to a version of python and trying to run the program using another python version

    So to start off, run:

    which python
    python --version
    which pip
    

    make sure both are aligned, most probably, python is 2.7 and pip is working on 3.x or pip is coming from anaconda's python version which is highly likely to be 3.x as well

    Incase of python redirects to 2.7, and pip redirects to pip3, install pandas using pip install pandas and use python3 file_name.py to run the program.

    0 讨论(0)
提交回复
热议问题