Python Forum
Array problem in pylab module - Image processing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array problem in pylab module - Image processing
#1
Hello Python community,
I am trying to load an image into a pylab array. All packages are installed as it should be but I keep receiving the following error when running my code:

img = pl.array(Image.open("Empire2.jpg"))
AttributeError: module 'pylab' has no attribute 'array'

My code is :
from PIL import Image
import pylab as pl

img = pl.array(Image.open("Empire2.jpg"))
pl.imshow(img)
x = [100,100,400,400]
y = [200,300,200,400]
plot(x,y,"r*")
plot(x[:2],y[:2])
title("Plotting the Empire")
show()
I verified for any file named pylab.py in my working directory (from Internet search), but still no luck.

Thanks for the help and Happy New Year to ALL!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with memory_graph module akbarza 3 298 Mar-04-2024, 10:15 AM
Last Post: snippsat
  Convert numpy array to image without loading it into RAM. DreamingInsanity 7 5,727 Feb-08-2024, 09:38 AM
Last Post: paul18fr
  problem using coloeama module akbarza 3 514 Jan-08-2024, 07:31 AM
Last Post: akbarza
  problem in using subprocess module akbarza 5 944 Sep-24-2023, 02:02 PM
Last Post: snippsat
  problem in import module from other folder akbarza 5 1,260 Sep-01-2023, 07:48 AM
Last Post: Gribouillis
  problem in using pyqrcode module to create QRcode akbarza 9 1,798 Aug-23-2023, 04:17 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 934 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  Problem with module time and leap seconds Pedroski55 3 1,190 Oct-07-2022, 11:27 PM
Last Post: Pedroski55
  Problem with Json Array kwekey 2 1,645 Aug-02-2021, 05:11 PM
Last Post: kwekey
  PyPDF2 processing problem Pavel_47 6 9,645 May-04-2021, 06:58 AM
Last Post: chaitanya

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020