首页 > 解决方案 > 安装后导入 fastai 库时出现错误

问题描述

我想使用 fastai 库来执行文本处理。第一份工作我安装了 fastai 库。我以前导入它,但没有任何代码,它只给出一个导入错误。

我正在使用 Python 3.5.2

我的操作系统 Ubuntu 16.04

asd.py

from fastai import *
from fastai.text import *

输出:

Traceback (most recent call last):
  File "/home/ali/Desktop/asd.py", line 2, in <module>
    from fastai.text import *
  File "/home/ali/Desktop/env/lib/python3.5/site-packages/fastai/text.py", line 8
    re_tok = re.compile(f'([{string.punctuation}“”¨«»®´·º½¾¿¡§£₤‘’])')
                                                                ^
SyntaxError: invalid syntax

只是下载和导入库可能是由这个错误引起的。

标签: pythonpython-3.xfast-ai

解决方案


推荐阅读