错误:包“imageio”需要不同的 Python:2.7.17 不在“>=3.5”中

问题描述 投票:0回答:1

我正在做医学图像分析,因为我需要

imageio
中的包
jupyter notebook
。我正在写这个命令

!pip install imageio

给我这样的错误

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting imageio
  Using cached imageio-2.9.0.tar.gz (3.3 MB)
ERROR: Package 'imageio' requires a different Python: 2.7.17 not in '>=3.5'

我的

kernel 
Jupyter 一套设置为
Python3

!python3 --version 
Python 3.6.3 :: Anaconda, Inc. 

我试过了

!pip3 install imageio

使用此输出正确安装了它

Requirement already satisfied: imageio in /home/jayakumars/anaconda3/envs/fastai2/lib/python3.6/site-packages (2.15.0)
Requirement already satisfied: numpy in /home/jayakumars/anaconda3/envs/fastai2/lib/python3.6/site-packages (from imageio) (1.19.5)
Requirement already satisfied: pillow>=8.3.2 in /home/jayakumars/anaconda3/envs/fastai2/lib/python3.6/site-packages (from imageio) (8.4.0)

但还是当

import
imageio 
包裹

import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import glob
import nibabel as nib
import cv2
import imageio
from tqdm.notebook import tqdm
from ipywidgets import *
from PIL import Image
from fastai.basics import *
from fastai.vision.all import *
from fastai.data.transforms import *

给我

ImportError

ImportError                               Traceback (most recent call last)
<ipython-input-40-9c1456a18eb5> in <module>()
      6 import nibabel as nib
      7 import cv2
----> 8 import imageio
      9 from tqdm.notebook import tqdm
     10 from ipywidgets import *

ImportError: No module named imageio

那么,我该如何安装它?

我尝试了

pip3 
并且我希望删除
imageio ``importError

python jupyter-notebook importerror python-imageio
1个回答
0
投票

您的Python是

3.6.3
,您需要将Python升级到
3.8
或更高版本。

enter image description here

https://pypi.org/project/imageio/

© www.soinside.com 2019 - 2024. All rights reserved.