0

Already, I have used the bytescale in my python 3.6. code, that here is its explanation. After installation of Scipy based on Anaconda, it is imported without any problem, but an import error occurred after (from scipy.misc import bytescale)

So,

import scipy.io as sio  # without any error

from scipy.misc import bytescale # with an error.

Error:

 ImportError: cannot import name 'bytescale' from 'scipy.misc'

Also,

Version of Python is 3.7, Windows 10

scipy                     1.3.1            py37h29ff71c_0    anaconda

pillow                    6.1.0            py37hdc69c19_0

Then, I found that "bytescale is deprecated! bytescale is deprecated in SciPy 1.0.0, and will be removed in 1.2.0". Now, I need to a function that works such as bytescale in Python 3.7.

Is there any function such as "bytescale" in Python 3.7.?

Ellie
  • 303
  • 2
  • 16
  • Try ```pip install PIL``` or ```pip3 install Pillow```. Also, have you checked this [post](https://stackoverflow.com/questions/9298665/cannot-import-scipy-misc-imread)? – MrCorote Oct 06 '19 at 14:26
  • @Pedro Henrique: I saw the link and I installed `Pillow` but the problem not resolved. Also for `pip install PIL`: `ERROR: Could not find a version that satisfies the requirement PIL (from versions: none).` `ERROR: No matching distribution found for PIL.` – Ellie Oct 06 '19 at 14:32
  • `scipy.misc.bytescale` was deprecated in SciPy 1.0 and removed from SciPy 1.2. – Warren Weckesser Oct 06 '19 at 18:16
  • What do you need `bytescale` for? – hpaulj Oct 06 '19 at 21:39
  • @hpaulj: I used `bytescale` instead of `im2uint8` (Matlab); Ex: `Output = bytescale(img.astype(float), cmin=-32768, cmax=32767)` – Ellie Oct 07 '19 at 16:41
  • @gnovice: Is there any functions such as `bytescale` for python 3.7.? – Ellie Nov 13 '19 at 16:18

0 Answers0