LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-16-2020, 05:49 AM   #1
cmk77
Member
 
Registered: May 2006
Location: netherlands
Distribution: debian, rocky, slackware
Posts: 132

Rep: Reputation: 25
slackbuild matplotlib fails with NameError


Using Slackware 14.2 and SlackBuilds, I'm trying to build matplotlib for default python, but got the following error. Any idea what could be wrong?

Code:
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [2.2.3]
                python: yes [2.7.17 (default, Oct 20 2019, 14:16:51)  [GCC
                        5.5.0]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.14.3]
Traceback (most recent call last):
  File "setup.py", line 172, in <module>
    result = package.check()
  File "/tmp/SBo/matplotlib-2.2.3/setupext.py", line 1480, in check
    print_status(package.name, req_fail_msg)
NameError: global name 'package' is not defined
 
Old 03-16-2020, 08:05 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,150

Rep: Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217
I just tried it and it built fine here: the line after the numpy one in my output is
Code:
      install_requires: yes [all third-party python packages are present]
have you installed all of the dependencies listed on this page (and the dependencies of the dependencies and so on...)?
I had to install these packages to let it build
Code:
six
singledispatch
futures
python-certifi
backports-abc
tornado
kiwisolver
subprocess32
setuptools-scm
functools-lru-cache
cycler
pytz
pyparsing
python-dateutil
numpy
matplotlib

Last edited by ponce; 03-16-2020 at 08:06 AM.
 
Old 03-16-2020, 08:45 AM   #3
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
I've had that issue with the matplotlib SlackBuild before too. For me it was fixed by commenting out this line in matplotlib.SlackBuild:

Code:
# Use modified setupext.py to make sure that the build process gets
# interrupted if requirements are not fulfilled
#
cat "${CWD}/setupext.py" > setupext.py
But please make sure you have all the dependencies installed first, because this will bypass the feature that you see in that comment. I think this is a bug in the modified setupext.py script, but my limited attempt to track it down in the past was not successful (and obviously the script must work for some people).
 
Old 03-16-2020, 09:04 AM   #4
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Actually, I think this might fix it. Please give this change to setupext.py a try before commenting out the line in the SlackBuild mentioned previously.

Code:
--- setupext.py	2020-03-16 10:02:52.376214282 -0400
+++ setupext.py.new	2020-03-16 10:03:34.462812966 -0400
@@ -1477,7 +1477,7 @@
             req_fail_msg += (os.linesep.join(not_available) +
                             os.linesep*(2*sp_mult)) * min(1, len(not_available))
             req_fail_msg += (os.linesep*2).join(wrong_version)
-            print_status(package.name, req_fail_msg)
+            print_status(pack_name, req_fail_msg)
             raise CheckFailed("missing or faulty third-party python packages")
         return "all third-party python packages are present"
 
Old 03-16-2020, 10:44 AM   #5
cmk77
Member
 
Registered: May 2006
Location: netherlands
Distribution: debian, rocky, slackware
Posts: 132

Original Poster
Rep: Reputation: 25
@ponce: not yet, I'm in dependency hell. But the script shouldn't break, it should tell me which deps I'm missing. And it actually did for numpy!

@montagdude: yes, that change fixes the problem, now I get a nice list of missing deps, next one is subprocess32.

Code:
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [2.2.3]
                python: yes [2.7.17 (default, Oct 20 2019, 14:16:51)  [GCC
                        5.5.0]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.14.3]
          subprocess32: ERROR: At least one third-party python package is
                        missing or has the wrong version: cycler could not
                        be found pyparsing could not be found dateutil could
                        not be found pytz could not be found six could not
                        be found kiwisolver could not be found
                        backports.functools_lru_cache could not be found
                        subprocess32 could not be found
 
Old 03-16-2020, 10:51 AM   #6
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,150

Rep: Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217
Quote:
Originally Posted by cmk77 View Post
@ponce: not yet, I'm in dependency hell. But the script shouldn't break, it should tell me which deps I'm missing. And it actually did for numpy!
I think you are using the SlackBuilds.org' scripts wrong: before installing a specific script you should install whatever is listed in the relative *.info file as "REQUIRED" (and whatever is required by what's required and so on).
you are doing twice the work that has already been done for you by the maintainer of the script: as I told you, just building the needed SlackBuilds in order (they are listed above) I had a package ready for matplotlib in no time.

Last edited by ponce; 03-16-2020 at 10:53 AM.
 
Old 03-16-2020, 10:58 AM   #7
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Quote:
Originally Posted by ponce View Post
I think you are using the SlackBuilds.org' scripts wrong: before installing a specific script you should install whatever is listed in the relative *.info file as "REQUIRED" (and whatever is required by what's required and so on).
you are doing twice the work that has already been done for you by the maintainer of the script: as I told you, just building the needed SlackBuilds in order (they are listed above) I had a package ready for matplotlib in no time.
But the point remains that the custom setupext.py has a bug and isn't doing what it is intended to do. Rather than failing with a NameError, it should report the missing package and exit gracefully.
 
Old 03-16-2020, 12:27 PM   #8
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,150

Rep: Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217Reputation: 4217
Quote:
Originally Posted by montagdude View Post
But the point remains that the custom setupext.py has a bug and isn't doing what it is intended to do. Rather than failing with a NameError, it should report the missing package and exit gracefully.
if you think so report this to the matplotlib maintainer, maybe he will explain why he used this instead of the stock one (but a partial explaination seems to be also in the comment from the SlackBuild you quoted above).

Last edited by ponce; 03-16-2020 at 12:29 PM.
 
Old 03-16-2020, 12:49 PM   #9
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Quote:
Originally Posted by ponce View Post
if you think so report this to the matplotlib maintainer, maybe he will explain why he used this instead of the stock one (but a partial explaination seems to be also in the comment from the SlackBuild you quoted above).
I plan to when I get the opportunity. But maybe cmk77 can confirm, does the script still stop due to missing dependencies after the fix from post #4 is applied? I find it unlikely that the maintainer purposely put in a nonexistent variable name ("package") to make the script crash with an unhelpful (to the user) error message when a dependency is missing.

Last edited by montagdude; 03-16-2020 at 12:51 PM.
 
Old 03-17-2020, 04:59 AM   #10
cmk77
Member
 
Registered: May 2006
Location: netherlands
Distribution: debian, rocky, slackware
Posts: 132

Original Poster
Rep: Reputation: 25
Yes, after the fix from post #4 the script points the user to the missing dependency and stops gracefully.
 
Old 03-17-2020, 05:05 AM   #11
cmk77
Member
 
Registered: May 2006
Location: netherlands
Distribution: debian, rocky, slackware
Posts: 132

Original Poster
Rep: Reputation: 25
@ponce: yes, I'm doing this the wrong way. Matplotlib has 10 deps, some of which have other deps, slackbuilding it all in the right order will take time.
 
Old 03-17-2020, 06:07 AM   #12
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Quote:
Originally Posted by cmk77 View Post
@ponce: yes, I'm doing this the wrong way. Matplotlib has 10 deps, some of which have other deps, slackbuilding it all in the right order will take time.
Why not use sbopkg/sbotools/sboui?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> rank NameError: name 'rank' is not defined MADprograms Programming 2 02-26-2018 01:43 PM
Why I get error matplotlib.pyplot not found even after matplotlib install? sabaz Linux - Software 2 08-08-2017 06:00 PM
NameError: name 'keyUtils' is not defined bungeebones Linux - Server 0 03-08-2014 11:44 PM
Matplotlib: Need help fixing weird include error Neruocomp Linux - Software 1 09-15-2005 06:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration