TypeError in installing Matplotlib

Asked by Kasinath Das

Hi ma5 team,
      while installing matplotlib in version 1.4 I got the following error. (I am working with root version 5.34 and python version 2.7.12). Can you please tell me the reason behind this ?

ma5>install matplotlib
MA5:
MA5: **********************************************************
MA5: Installing matplotlib
MA5: **********************************************************
MA5: Detecting a previous installation ...
MA5: => found
MA5: Removing the previous installation ...
 ** WARNING: Are you sure to remove the directory called '/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/tools/matplotlib' ? (Y/N)
Answer: y
MA5: Creating a devoted folder ...
MA5: Creating a temporary folder ...
MA5: Downloading the package ...
MA5: - 1/1 http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz ...
MA5: 'matplotlib.tar.gz' already exists. Package not downloaded.
MA5: Unpacking the package ...
Traceback (most recent call last):
  File "./bin/ma5", line 70, in <module>
    madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
  File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/core/launcher.py", line 324, in LaunchMA5
    repeat = MainSession(mode,arglist,ma5dir,version,date)
  File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/core/launcher.py", line 237, in MainSession
    interpreter.cmdloop()
  File "/opt/anaconda2/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/opt/anaconda2/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/interpreter/interpreter.py", line 251, in do_install
    result = self.cmd_install.do(self.split_arg(line))
  File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/interpreter/cmd_install.py", line 147, in do
    return installer.Execute('matplotlib')
  File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/install/install_manager.py", line 140, in Execute
    if not installer.Unpack():
  File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/install/install_matplotlib.py", line 89, in Unpack
    ok, packagedir = InstallService.untar(logname, self.tmpdir,'matplotlib.tar.gz')
TypeError: untar() takes exactly 4 arguments (3 given)

With regards,
Kasinath

Question information

Language:
English Edit question
Status:
Answered
For:
MadAnalysis 5 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Benjamin Fuks (fuks) said :
#1

Hi Kasinath,

I just fixed the issue in v1.5beta. You need to edit the file
   madanalysis/install/install_matplotlib.py
and replace the line
         ok, packagedir = InstallService.untar(logname, self.tmpdir,'matplotlib.tar.gz')
by
         ok, packagedir = InstallService.untar(logname, self.downloaddir,self.tmpdir,'matplotlib.tar.gz')

Cheers,

Benjamin

PS: note that the installation may fail if not all dependencies are avaible on your system.

On 21 Sep 2016, at 09:22 , Kasinath Das <email address hidden> wrote:

> New question #401599 on MadAnalysis 5:
> https://answers.launchpad.net/madanalysis5/+question/401599
>
> Hi ma5 team,
> while installing matplotlib in version 1.4 I got the following error. (I am working with root version 5.34 and python version 2.7.12). Can you please tell me the reason behind this ?
>
> ma5>install matplotlib
> MA5:
> MA5: **********************************************************
> MA5: Installing matplotlib
> MA5: **********************************************************
> MA5: Detecting a previous installation ...
> MA5: => found
> MA5: Removing the previous installation ...
> ** WARNING: Are you sure to remove the directory called '/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/tools/matplotlib' ? (Y/N)
> Answer: y
> MA5: Creating a devoted folder ...
> MA5: Creating a temporary folder ...
> MA5: Downloading the package ...
> MA5: - 1/1 http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz ...
> MA5: 'matplotlib.tar.gz' already exists. Package not downloaded.
> MA5: Unpacking the package ...
> Traceback (most recent call last):
> File "./bin/ma5", line 70, in <module>
> madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
> File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/core/launcher.py", line 324, in LaunchMA5
> repeat = MainSession(mode,arglist,ma5dir,version,date)
> File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/core/launcher.py", line 237, in MainSession
> interpreter.cmdloop()
> File "/opt/anaconda2/lib/python2.7/cmd.py", line 142, in cmdloop
> stop = self.onecmd(line)
> File "/opt/anaconda2/lib/python2.7/cmd.py", line 221, in onecmd
> return func(arg)
> File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/interpreter/interpreter.py", line 251, in do_install
> result = self.cmd_install.do(self.split_arg(line))
> File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/interpreter/cmd_install.py", line 147, in do
> return installer.Execute('matplotlib')
> File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/install/install_manager.py", line 140, in Execute
> if not installer.Unpack():
> File "/c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/madanalysis/install/install_matplotlib.py", line 89, in Unpack
> ok, packagedir = InstallService.untar(logname, self.tmpdir,'matplotlib.tar.gz')
> TypeError: untar() takes exactly 4 arguments (3 given)
>
>
> With regards,
> Kasinath
>
>
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
Kasinath Das (kasinath-das91) said :
#2

Hi Benjamin,
     I did change according you have mentioned. Again it showed me another following error

MA5: Building the package ...
 ** ERROR: impossible to build the project. For more details, see the log file:
 ** ERROR: /c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/tools/matplotlib/compilation.log
MA5: Installation NOT complete.
MA5: => Status: [FAILURE]

Here I am giving error part of the compilation.log file.

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__png_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/opt/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/opt/anaconda2/include/libpng16 -I/opt/anaconda2/include/python2.7 -c src/_png.cpp -o build/temp.linux-x86_64-2.7/src/_png.o
In file included from /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781,
                 from /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from src/_png.cpp:28:
/opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
In file included from src/file_compat.h:4,
                 from src/_png.cpp:31:
/opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘PyObject* npy_PyFile_OpenFile(PyObject*, const char*)’:
/opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h:303: warning: deprecated conversion from string constant to ‘char*’
/opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘int npy_PyFile_CloseFile(PyObject*)’:
/opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h:311: warning: deprecated conversion from string constant to ‘char*’
src/_png.cpp: In member function ‘Py::Object _png_module::write_png(const Py::Tuple&)’:
src/_png.cpp:147: error: ‘npy_PyFile_Dup’ was not declared in this scope
src/_png.cpp:243: error: ‘npy_PyFile_DupClose’ was not declared in this scope
src/_png.cpp:264: error: ‘npy_PyFile_DupClose’ was not declared in this scope
src/_png.cpp: In member function ‘PyObject* _png_module::_read_png(const Py::Object&, bool, int)’:
src/_png.cpp:329: error: ‘npy_PyFile_Dup’ was not declared in this scope
src/_png.cpp:577: error: ‘npy_PyFile_DupClose’ was not declared in this scope
error: command 'gcc' failed with exit status 1

I am working with python version 2.7.12 and numpy version 1.10.4.

Thank you,
Kasinath

Revision history for this message
Benjamin Fuks (fuks) said :
#3

Mhhh. Which version of gcc do you have? Hae you tried to install matplotlib externally?

Cheers,

Benjamin

On 21 Sep 2016, at 20:43 , Kasinath Das <email address hidden> wrote:

> Question #401599 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/401599
>
> Status: Answered => Open
>
> Kasinath Das is still having a problem:
> Hi Benjamin,
> I did change according you have mentioned. Again it showed me another following error
>
>
> MA5: Building the package ...
> ** ERROR: impossible to build the project. For more details, see the log file:
> ** ERROR: /c11scratch/kasinath/Program/madanalysis5_1.4/madanalysis5/tools/matplotlib/compilation.log
> MA5: Installation NOT complete.
> MA5: => Status: [FAILURE]
>
>
> Here I am giving error part of the compilation.log file.
>
> gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__png_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/opt/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/opt/anaconda2/include/libpng16 -I/opt/anaconda2/include/python2.7 -c src/_png.cpp -o build/temp.linux-x86_64-2.7/src/_png.o
> In file included from /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781,
> from /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
> from /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
> from src/_png.cpp:28:
> /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
> In file included from src/file_compat.h:4,
> from src/_png.cpp:31:
> /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘PyObject* npy_PyFile_OpenFile(PyObject*, const char*)’:
> /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h:303: warning: deprecated conversion from string constant to ‘char*’
> /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘int npy_PyFile_CloseFile(PyObject*)’:
> /opt/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h:311: warning: deprecated conversion from string constant to ‘char*’
> src/_png.cpp: In member function ‘Py::Object _png_module::write_png(const Py::Tuple&)’:
> src/_png.cpp:147: error: ‘npy_PyFile_Dup’ was not declared in this scope
> src/_png.cpp:243: error: ‘npy_PyFile_DupClose’ was not declared in this scope
> src/_png.cpp:264: error: ‘npy_PyFile_DupClose’ was not declared in this scope
> src/_png.cpp: In member function ‘PyObject* _png_module::_read_png(const Py::Object&, bool, int)’:
> src/_png.cpp:329: error: ‘npy_PyFile_Dup’ was not declared in this scope
> src/_png.cpp:577: error: ‘npy_PyFile_DupClose’ was not declared in this scope
> error: command 'gcc' failed with exit status 1
>
>
> I am working with python version 2.7.12 and numpy version 1.10.4.
>
>
> Thank you,
> Kasinath
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
Kasinath Das (kasinath-das91) said :
#4

Hi Benjamin,
           My gcc version is 4.4.7 . I have tried to install matplotlib from the ma5 command interface as follows.

         ./bin/ma5

       then ma5 > install matplotlib

Thank you,
Kasinath

Revision history for this message
Benjamin Fuks (fuks) said :
#5

Hi Kasinath,

Could you pelase try an external installation (outside ma5), to see whether this works?

Cheers,

Benjamin

On 22 Sep 2016, at 08:32 , Kasinath Das <email address hidden> wrote:

> Question #401599 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/401599
>
> Status: Answered => Open
>
> Kasinath Das is still having a problem:
> Hi Benjamin,
> My gcc version is 4.4.7 . I have tried to install matplotlib from the ma5 command interface as follows.
>
> ./bin/ma5
>
> then ma5 > install matplotlib
>
>
> Thank you,
> Kasinath
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Can you help with this problem?

Provide an answer of your own, or ask Kasinath Das for more information if necessary.

To post a message you must log in.