首页 > 解决方案 > 如何在macos Mojave上修复python中的错误13?

问题描述

我无法执行简单的 python 代码。
错误信息:

(Traceback (most recent call last):
  File "/Users/vervit/Desktop/python/new1.py", line 1, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas')

pandas, matplotlib,numpy已经安装了。pip, conda,python更新到最新版本

我已经尝试过的代码
1) sudo python your_python_script.py
2) sudo chmod a+rw /path/to/folder/that/you/want/to/write/to
3) python3 -m venv env
source ./env/bin/activate
python -m pip install google-assistant-sdk[samples]
4) 将包安装到用户文件夹: python -m pip install --user google-assistant-sdk[samples]

没有任何工作

import pandas as pd
import Quandl
df = Quandl.get('WIKI/GOOGL')
print(df.head())

应该显示股票价格。

标签: python-3.xpandasmacos

解决方案


推荐阅读