原以为没有这些包,在终端安装了好久,都是包已存在,这样的错误……
Requirement already satisfied: pytz>=2017.3 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from pandas) (2021.1)
没想到,竟是?python3.sublime-build 的 问题
mac-sublime默认运行python2版本,mac自带python2……
mac安装sublime流程
MAC系统下Sublime Text3 配置Python3详细教程(亲测有效)_热河路的博客-CSDN博客这段时间由于想要学习Python,看到了有人推荐sublime text3这一款简洁的编辑器,便下载来试一下。由于学习的是Python3,在这款软件里面是不包含的,因此环境需要再自己配置一遍,在网上看了许多的教程,苦苦没有找到一个有效的,今天看书的时候才发现了正确的配置过程,特地来分享一下,希望大家少走弯路吧。检测Python3是否已经安装打开终端,输入python3,如果显示如...https://blog.csdn.net/weixin_41768008/article/details/79859008若运行pandas、numpy、PIL等其他包,出现一下错误:
Traceback (most recent call last): ? File "/Users/X/Desktop/P/test.py", line 3, in <module> ? ? import numpy as np? ModuleNotFoundError: No module named 'numpy' [Finished in 72ms with exit code 1] [cmd: ['/usr/bin/python3', '-u', '/Users/X/Desktop/Ptest.py']] [dir: /Users/Xg/Desktop/P] [path: /opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin]
可将python3.sublime-build中的代码改为:
{
"cmd": ["/usr/local/bin/python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
Ps:要注意添加上 /local。?
如果之前已经建立过python3.sublime-build文件,可通过一下方式打开文件,重新编写:
python3.sublime-build在资源库/Application Support/Sublime Text 3/Packages/User
资源库在mac-finder中显示:点击访达右上角圆圈三点
?
|