gpt4 book ai didi

python - 导入错误 : No module named 'pandas' Using Ubuntu

转载 作者:太空狗 更新时间:2023-10-29 21:08:09 24 4
gpt4 key购买 nike

$ pip3 install pandas
Requirement already satisfied (use --upgrade to upgrade): pandas in /usr/local/lib/python3.4/dist-packages
Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=2 in /usr/local/lib/python3.4/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): pytz>=2011k in /usr/local/lib/python3.4/dist-packages (from pandas)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.7.0 in /usr/local/lib/python3.4/dist-packages (from pandas)

我的系统已经满足所有要求时出现导入错误。

最佳答案

为确保您没有混淆多个 Python 版本,您应该运行这些命令

python -m pip install pandas
python -c 'import pandas'

它安装 pandas 并使用相同的 python 版本导入它。

当然,你必须更新上面命令中的python程序,以防它不是直接python

如果你有一个python3可执行文件,你可以试试

python3 -m pip install pandas
python3 -c 'import pandas'

您甚至可以使用绝对路径,它将由 which pythonwhich python2which python3 返回,...

关于python - 导入错误 : No module named 'pandas' Using Ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44015941/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com