Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: ImportError: cannot import name 'imread' from 'scipy.misc' #15227

Closed
Gauravmatade opened this issue Dec 16, 2021 · 1 comment
Closed

BUG: ImportError: cannot import name 'imread' from 'scipy.misc' #15227

Gauravmatade opened this issue Dec 16, 2021 · 1 comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected

Comments

@Gauravmatade
Copy link

Describe your issue.

plz help me

Reproducing Code Example

from scipy.misc import imread
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import os
sDataBaseDir='C:/VKHCG/05-DS/9999-Data/temp'
f=0
for file in os.listdir(sDataBaseDir):
    if file.endswith(".jpg"):
        f += 1
sInputFileName=os.path.join(sDataBaseDir, file)
print('Process : ', sInputFileName)
InputData = imread(sInputFileName, flatten=False, mode='RGBA')
print('Input Data Values ===================================')
print('X: ',InputData.shape[0])
print('Y: ',InputData.shape[1])
print('RGBA: ', InputData.shape[2])
print('=====================================================')
ProcessRawData=InputData.flatten()
y=InputData.shape[2] + 2
x=int(ProcessRawData.shape[0]/y)
ProcessFrameData=pd.DataFrame(np.reshape(ProcessRawData, (x, y)))
ProcessFrameData['Frame']=file
print('=====================================================')
print('Process Data Values =================================')
print('=====================================================')
plt.imshow(InputData)
plt.show()
if f == 1:
    ProcessData=ProcessFrameData
else:
    ProcessData=ProcessData.append(ProcessFrameData)
if f > 0:
    sColumns= ['XAxis','YAxis','Red', 'Green', 'Blue','Alpha','FrameName']
ProcessData.columns=sColumns
print('=====================================================')
ProcessFrameData.index.names =['ID']
print('Rows: ',ProcessData.shape[0])
print('Columns :',ProcessData.shape[1])
print('=====================================================')
OutputData=ProcessData
print('Storing File')
sOutputFileName='C:/VKHCG/05-DS/9999-Data/HORUS-Movie-Frame.csv'
OutputData.to_csv(sOutputFileName, index = False)
print('=====================================================')
print('Processed ; ', f,' frames')
print('=====================================================')
print('Movie to HORUS - Done')
print('=====================================================')

Error message

from scipy.misc import imread
ImportError: cannot import name 'imread' from 'scipy.misc' (C:\pythom39\lib\site-packages\scipy\misc\__init__.py)

SciPy/NumPy/Python version information

scipy Version: 1.7.1 python version:3.9.6

@Gauravmatade Gauravmatade added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Dec 16, 2021
@ilayn
Copy link
Member

ilayn commented Dec 16, 2021

Please google the error message first if you can. The function is removed a number of years ago. https://stackoverflow.com/questions/15345790/scipy-misc-module-has-no-attribute-imread

@ilayn ilayn closed this as completed Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected
Projects
None yet
Development

No branches or pull requests

2 participants