【发布时间】:2019-05-07 20:57:25
【问题描述】:
我正在尝试让 profanity_check 在 EC2 Linux 实例上运行。
问题是当我尝试使用 python34 profanity.py 运行 profanity.py 时收到 ImportError: No module named profanity_check 错误。
此外,当尝试运行 python profanity.py 时,我收到 ValueError: unsupported pickle protocol: 3 错误。
我认为这是因为 profanity_check 仅适用于 Python 3。
此外,我在安装 profanity-check 时收到了 DEPRECATION: Python 2.7 will reach the end of its life 警告。但是,我已经在系统上安装了 Python 3.4.9。
根据这个问题here 我已经检查了__init__.py 文件。它存在并且看起来很稳定。
__init__.py 文件的路径如下:
/home/ec2-user/.local/lib/python2.7/site-packages/profanity_check/init.py
这可能是什么问题?
profanity.py
#!/usr/bin/python34
from profanity_check import predict, predict_prob
predict(['predict() takes an array and returns a 1 for each string if it is offensive, else 0.'])
# [0]
__init__.py
from .profanity_check import predict, predict_prob
__version__="1.0.2"
【问题讨论】:
标签: python linux amazon-ec2 package