0

I was using scikit-image 0.18 version. To use seam_carve(), I have to downgrade it to 0.14.2 version.

Here was what I did:

  1. Firstly remove existing newer version 0.18
conda remove scikit-image

The following packages will be REMOVED:

  scikit-image-0.18.1-py38hf11a4ad_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

  1. after removing previous newer version, then I re-install scikit-image 0.14.2
pip install scikit-image==0.14.2

Requirement already satisfied: decorator>=4.3.0 in c:\users\test\miniconda3\envs\skimage14\lib\site-packages (from networkx>=1.8->scikit-image==0.14.2) (4.4.2)

The above said I have already have 0.14.2 version. The reason is that: before I removed newer version before, I was using

pip install --upgrade scikit-image==0.14.2 

It didn't work, that is why I started to use step 1 to uninstall it.

  1. then I tried to test which version is installed now
>>> import skimage
>>> print(skimage.__version__)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'skimage' has no attribute '__version__'

skimage can be imported, but why I cannot check its version by using skimage.version

Thanks for your help

roudan
  • 3,082
  • 5
  • 31
  • 72

1 Answers1

1

__version__ is not a default for python, but is something that many libraries use. skimage version 0.18.3 uses it but version 0.14.2 doesn't necessarily use it.

This should help you find out the correct version:

https://stackoverflow.com/a/56331414

Thomas Q
  • 850
  • 4
  • 10
  • 1
    Curiously, the v0.14.2 release of skimage _does_ define `__version__`. See https://github.com/scikit-image/scikit-image/blob/v0.14.2/skimage/__init__.py#L76 – Brian61354270 Oct 03 '21 at 23:43
  • I followed the above link and do dir(skimage), and it only show ['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']. There is no version and its variant. – roudan Oct 03 '21 at 23:48
  • 1
    @roudan That suggests that you're not importing the skimage package but rather a local module that happens to be named `skimage.py`. Could you check what `skimage.__file__` is? – Brian61354270 Oct 03 '21 at 23:51
  • Thanks Brian, then how do I import skimage? I was using import skimage – roudan Oct 03 '21 at 23:52
  • I did again try to remove skimage: (skimage14) by using conda remove skimage Collecting package metadata (repodata.json): done Solving environment: failed PackagesNotFoundError: The following packages are missing from the target environment: - skimage . It show package not found. so I reinstalled it using pip install scikit-image==0.14.2. Then it said requirement satisfied. I think something wrong with this skimage. How do I completely remove it and reinstall it? Thanks – roudan Oct 03 '21 at 23:53