Python-PCB icon indicating copy to clipboard operation
Python-PCB copied to clipboard

Nothing displayed on the PCB viewer window

Open Varat7v2 opened this issue 3 years ago • 11 comments

When I run this command pypy pcb.py --v 1 netlist.pcb | python view.py, it gets executed with pcb viewed popped up with nothing in it. The following errors are thrown. Can you please tell I am missing? Thanks in advance.

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1892, in __call__
    return self.func(*args)
  File "/usr/lib/python3.8/tkinter/__init__.py", line 814, in callit
    func(*args)
  File "view.py", line 81, in doframe
    scale_and_split_tracks(tracks, scale)
  File "view.py", line 44, in scale_and_split_tracks
    track[4] = split_paths(track[4])
  File "view.py", line 25, in split_paths
    _, _, zb = b
TypeError: cannot unpack non-iterable NoneType object
Traceback (most recent call last):
  File "view.py", line 226, in <module>
    main()
  File "view.py", line 223, in main
    image.save(args.i[0])	
AttributeError: 'NoneType' object has no attribute 'save'
Traceback (most recent call last):
  File "pcb.py", line 74, in <module>
    main()
  File "pcb.py", line 59, in main
    if not pcb.route(args.t[0]):
  File "/home/Python-PCB/router.py", line 128, in route
    self.print_netlist()
  File "/home/Python-PCB/router.py", line 146, in print_netlist
    net.print_net()
  File "/home/Python-PCB/router.py", line 296, in print_net
    [[(x * scale, y * scale, z) for x, y, z in spath] for spath in spaths]]
IOError: [Errno 32] Broken pipe: '<fdopen>'

Varat7v2 avatar Nov 01 '21 17:11 Varat7v2

Wow, long time back project !

Not sure I have Python even installed at the moment. But I’ll take a look tomorrow to see how if I can get it going again for you. !

The C++ version is much more up to date btw.

Regards

Chris

—————- Chris Hinsley

On 1 Nov 2021, at 5:35 pm, Bharat Bohara @.***> wrote:

 When I run this command pypy pcb.py --v 1 netlist.pcb | python view.py, it gets executed with pcb viewed popped up with nothing in it. The following errors are thrown. Can you please tell I am missing? Thanks in advance.

Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python3.8/tkinter/init.py", line 1892, in call return self.func(*args) File "/usr/lib/python3.8/tkinter/init.py", line 814, in callit func(*args) File "view.py", line 81, in doframe scale_and_split_tracks(tracks, scale) File "view.py", line 44, in scale_and_split_tracks track[4] = split_paths(track[4]) File "view.py", line 25, in split_paths _, _, zb = b TypeError: cannot unpack non-iterable NoneType object Traceback (most recent call last): File "view.py", line 226, in main() File "view.py", line 223, in main image.save(args.i[0]) AttributeError: 'NoneType' object has no attribute 'save' Traceback (most recent call last): File "pcb.py", line 74, in main() File "pcb.py", line 59, in main if not pcb.route(args.t[0]): File "/home/Python-PCB/router.py", line 128, in route self.print_netlist() File "/home/Python-PCB/router.py", line 146, in print_netlist net.print_net() File "/home/Python-PCB/router.py", line 296, in print_net [[(x * scale, y * scale, z) for x, y, z in spath] for spath in spaths]] IOError: [Errno 32] Broken pipe: ''

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

vygr avatar Nov 01 '21 17:11 vygr

Oh thank you Chris. Please take your time. I ought to use auto-routing for the PCB board in my project. Your work is really awesome and thank you for making it public.

Varat7v2 avatar Nov 01 '21 18:11 Varat7v2

Just had a go at getting things to run via installing HomeBrew and Python again, but only Python3 coming down from HomeBrew these days !, so things are very out of date. This would need upgrading to Python3 in order to get it going again.

vygr avatar Nov 01 '21 18:11 vygr

Trying to run the main solver does seams to work ! Even with Python3, the viewer has the issues !

vygr avatar Nov 01 '21 18:11 vygr

OK, something going again....

Install matplotlib with pip3 and use the view_mpl.py viewer with this mod so get passed an issue with the select lib.

poll = None
# if os.name != 'nt':
# 	if args.infile == sys.stdin:
# 		poll = select.poll()
# 		poll.register(args.infile, select.POLLIN)

Comment out those 4 lines for now.

Then:

pypy pcb.py --v 1 netlist.pcb | python view_mpl.py

vygr avatar Nov 01 '21 18:11 vygr

This is using pypy from Homebrew on MacOS, and python2.7 from MacOS itslef for running the view_mpl.py.

But that at least gets somewhere !

vygr avatar Nov 01 '21 18:11 vygr

Screenshot 2021-11-01 at 18 57 09

vygr avatar Nov 01 '21 19:11 vygr

I am running this code on Ubunutu 20.04 and my python version is 3.8. Still I am having some errors while running the script: pypy pcb.py --v 1 netlist.pcb | python view_mpl.py and getting these errors. I have commented the lines you have mentioned above: https://github.com/vygr/Python-PCB/issues/1#issuecomment-956497416.

Traceback (most recent call last):
  File "/home/varat/envs/cv/lib/python3.8/site-packages/matplotlib/cbook/__init__.py", line 224, in process
    func(*args, **kwargs)
  File "/home/varat/envs/cv/lib/python3.8/site-packages/matplotlib/animation.py", line 959, in _start
    self._init_draw()
  File "/home/varat/envs/cv/lib/python3.8/site-packages/matplotlib/animation.py", line 1703, in _init_draw
    self._draw_frame(next(self.new_frame_seq()))
  File "/home/varat/envs/cv/lib/python3.8/site-packages/matplotlib/animation.py", line 1726, in _draw_frame
    self._drawn_artists = self._func(framedata, *self._args)
  File "view_mpl.py", line 81, in doframe
    scale_and_split_tracks(tracks, scale)
  File "view_mpl.py", line 46, in scale_and_split_tracks
    track[4] = split_paths(track[4])
  File "view_mpl.py", line 27, in split_paths
    _, _, zb = b
TypeError: cannot unpack non-iterable NoneType object

And this error when closing the blank popped up window.


Traceback (most recent call last):
  File "pcb.py", line 74, in <module>
    main()
  File "pcb.py", line 59, in main
    if not pcb.route(args.t[0]):
  File "/home/varat/myPhD/Python-PCB/router.py", line 128, in route
    self.print_netlist()
  File "/home/varat/myPhD/Python-PCB/router.py", line 146, in print_netlist
    net.print_net()
  File "/home/varat/myPhD/Python-PCB/router.py", line 296, in print_net
    [[(x * scale, y * scale, z) for x, y, z in spath] for spath in spaths]]
IOError: [Errno 32] Broken pipe: '<fdopen>'

Varat7v2 avatar Nov 01 '21 20:11 Varat7v2

Python3.8 will definitely have a problem. The code was for 2.7. I can run on my MacBook with the build in Python 2.7 and pypy 2.7.

Might be an interesting exercise to try update to Python 3 at some point.

—————- Chris Hinsley

On 1 Nov 2021, at 8:48 pm, Bharat Bohara @.***> wrote:

 I am running this code on Ubunutu 20.04 and my python version is 3.8. Still I am having some errors while running the script: pypy pcb.py --v 1 netlist.pcb | python view_mpl.py and getting these errors

Traceback (most recent call last): File "/home/varat/envs/cv/lib/python3.8/site-packages/matplotlib/cbook/init.py", line 224, in process func(*args, **kwargs) File "/home/varat/envs/cv/lib/python3.8/site-packages/matplotlib/animation.py", line 959, in _start self._init_draw() File "/home/varat/envs/cv/lib/python3.8/site-packages/matplotlib/animation.py", line 1703, in _init_draw self._draw_frame(next(self.new_frame_seq())) File "/home/varat/envs/cv/lib/python3.8/site-packages/matplotlib/animation.py", line 1726, in _draw_frame self._drawn_artists = self._func(framedata, *self._args) File "view_mpl.py", line 81, in doframe scale_and_split_tracks(tracks, scale) File "view_mpl.py", line 46, in scale_and_split_tracks track[4] = split_paths(track[4]) File "view_mpl.py", line 27, in split_paths _, _, zb = b TypeError: cannot unpack non-iterable NoneType object And this error when closing the blank popped up window.

Traceback (most recent call last): File "pcb.py", line 74, in main() File "pcb.py", line 59, in main if not pcb.route(args.t[0]): File "/home/varat/myPhD/Python-PCB/router.py", line 128, in route self.print_netlist() File "/home/varat/myPhD/Python-PCB/router.py", line 146, in print_netlist net.print_net() File "/home/varat/myPhD/Python-PCB/router.py", line 296, in print_net [[(x * scale, y * scale, z) for x, y, z in spath] for spath in spaths]] IOError: [Errno 32] Broken pipe: '' — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

vygr avatar Nov 02 '21 08:11 vygr

@vygr Okay Chris I will try with Python 2.7. However, I would love to hear if you update for the Python3 version. Thank you.

Varat7v2 avatar Nov 02 '21 20:11 Varat7v2

Varat, prompted by your interest here, I finally decided to implement the ChrysaLisp version of the router ! That's in my version of Lisp, but it's now ahead of the C++ version in what it does. The C++ version is still faster, but that will not be for long :)

Please check out my ChrysaLisp project if you have not yet.

Regards

Chris

vygr avatar Nov 16 '21 12:11 vygr