在安装了pyenv的macos上使用python turtle模块

默认情况下macos下的brew和pyenv安装的python是不带turtle模块的,
如果你要使用的话,可以这样做:

  1. 去python官网下载macos的python安装包。它已经包含了Tk模块。
    Python Releases for Mac OS X | Python.org
    官网有个说明页面:
    IDLE and tkinter with Tcl/Tk on macOS | Python.org

If you are using a Python from any current python.org Python installer for macOS (3.8.0+, 3.7.2+, 3.6.8, or 2.7.16+), no further action is needed to use IDLE or tkinter. A built-in version of Tcl/Tk 8.6 will be used.

  1. 安装以后,需要将pyenv的环境变量从user profile中取消,然后重新source user profile。
  2. 此时就可以正常的使用turtle模块了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值