python - 如何使用 python 3.x 而不是 python 2.7.9 安装 praw
问题描述
我正在尝试安装 praw 以允许我制作 Reddit 机器人。我已经在 Windows 机器上实现了这一点,并成功制作了一个简单的机器人,但是在尝试在我的 mac 上安装 praw 时遇到了持续错误。
当我进入pip install praw
终端时,它说:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting praw
Using cached https://files.pythonhosted.org/packages/f6/df/b42c0a3b86a43a62a46e5b2f07930230ac7719624800a2052218993fb767/praw-6.4.0-py2.py3-none-any.whl
ERROR: Package 'praw' requires a different Python: 2.7.9 not in '>=3.4'
我的 Python 3 版本应该没问题:
$ python3 --version
Python 3.4.3
但我似乎无法使用 Python 3 安装它,它只想使用 Python 2 安装。
在 Windows 上,我可以简单地安装 Python 3,然后轻松安装 praw;但 MacOS 似乎使用 Python 2.7 作为某种默认值——我不确定如何覆盖。
解决方案
使用:python3 -m pip install praw
推荐阅读
- protocol-buffers - Protobuf 组和消息
- sql - PL/SQL 抛出错误 ORA-02289: 序列不存在 (Oracle SQL)
- java - Jboss 7.2 root-logger level DEBUG 在执行 jpa 查询时引发 ConcurrentModificationException
- excel - VBA - 从另一个文件中提取值的缓慢过程
- php - 如何让 GF 自定义字段输入被识别为输入(重力形式自定义插件)
- azure-iot-edge - Edge 和 Hub 之间的流量和大小
- php - Laravel 8:如何在模型中设置输出样式
- rabbitmq - 如何解决rabbitmq通道影响其他队列的问题
- javascript - 在 Nodejs 中读/写文件
- python - Python中的二进制文件处理