python paddlehub的安装

cmd安装命令:
首先需要安装pandle库

pip install paddlepaddle

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple –default-timeout=100 paddlehub

在jupyter lab中import库:

import pandle

import pandlehub as hub

发现提示错误,找不到pandlehub?可是可是可是,我明明安装了的说。别慌,用键盘输入以下一串代码,问题迎刃而解:

import importlib

import sys
sys.path.append(r’这里是你site-packages的路径,一般都在C盘的python38里面。不同人的路径和python版本不同,自己查看一下!’)
import setuptools

import warnings
warnings.filterwarnings(
“ignore”, “Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools’ objects directly or at least import Setuptools first.”, UserWarning, “setuptools.distutils_patch”)

接下来,重新导库:

import pandle
import pandlehub as hub