NameError: name 'center' is not defined

39 views
Skip to first unread message

Seth P

unread,
Aug 9, 2015, 4:02:33 PM8/9/15
to CVXOPT
I've encountered the following error in cvxopt 1.1.7 when used in 64-bit Python 3.4.3 on Windows 8.1.

C:\Python34\lib\site-packages\cvxopt\printing.py in matrix_str_default(X)
     71 
     72     if height < m:
---> 73         s += "[" + min(n,width)*(center(':',twidth)+' ')
     74 
     75         if width < n: s += '   ]\n'

NameError: name 'center' is not defined

Replacing the offending line with the following seems to fix the problem.
---> 73         s += "[" + min(n,width)*(':'.center(twidth)+' ')


Martin

unread,
Aug 10, 2015, 2:07:42 AM8/10/15
to CVXOPT
Thanks for pointing this out. We will fix it in the next release.

Martin 
Reply all
Reply to author
Forward
0 new messages