Solved Numpy and matplotlib installation

I am not able to install numpy and matplotlib using pip3 although they worked for pip2 in FreeBSD-11-p4.
Numpy installation ends with:
Code:
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-naf0akcl/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-pe9vcia8-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-naf0akcl/numpy/

while matplotlib installation ends with:
Code:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-v4znd0wy/matplotlib/

Also pygame requires portmidi and porttime to be installed which don't seem to have packages as I was trying to install these with pkg. Any idea about these?

Anyway I really need the earlier two to be solved as I don't want to move back to Linux. Thanks!
 
Thanks, it worked. But how do I do it for matplotoib? The same comamnd does'nt work for it.
 
Looks like there's an open bug for it already: PR 213636
The very first svndiff Makefile worked for me. I have had seen that work around in one of the mailing lists some time ago. I would not wonder if the introduction of flavors would help to clean up problems like that, one by one and pretty soon.
 
It says its for py35. Does it work for py36 as well?
How do I use those makefiles anyway?
It worked for me with py36 as well. I have replaced the original Makefile with the modified version. Additionally I have preserved a copy of the modified file as Makefile.orig in case the port is updated and the modification overwritten. Since I have checked the situation right now I have seen that there is a new Makefile with FLAVORS introduced. I have not tried it up to now. But it seems as if setting of the default python version as
Code:
DEFAULT_VERSIONS+=python=3.6 python2=2.7 python3=3.6
is no more honoured right now. I guess it will be fixed soon.
 
Usually tobik@ is always right :). His method should work. But I have not used make recently.
In the meantime try installing it with pip3.6 install --user matplotlib again. It works for me.
Therefore I there might be an issue with the port using the regular methods.
 
Code:
root@water:/usr/ports/math/py-matplotlib # make install
make: "/usr/ports/math/py-matplotlib/Makefile" line 3: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 4: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 15: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 21: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 33: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 34: Missing dependency operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 35: Missing dependency operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 37: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 38: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 39: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 40: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 43: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 44: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 45: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/ports/math/py-matplotlib

This is the error. Any workaround?
 
Code:
root@water:/usr/ports/math/py-matplotlib # make install
make: "/usr/ports/math/py-matplotlib/Makefile" line 3: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 4: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 15: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 21: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 33: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 34: Missing dependency operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 35: Missing dependency operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 37: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 38: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 39: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 40: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 43: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 44: Need an operator
make: "/usr/ports/math/py-matplotlib/Makefile" line 45: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/ports/math/py-matplotlib

This is the error. Any workaround?
That looks weird. The attachments in PR 213636 are diffs that need to be applied properly with patch(1) e.g. cd /usr/ports/math/py-matplotlib; patch -i /path/to/patch/file. You can't just copy them in.
 
Wait a moment. Can you please write the exact code in this case. Never done this before.
 
Dear akram65,
the first patch has been quite simple as
Code:
Index: Makefile
===================================================================
--- Makefile    (revision 429926)
+++ Makefile    (working copy)
@@ -27,7 +27,7 @@

 USE_GITHUB=    yes

-USES=        compiler:c++11-lib gettext pkgconfig python:2.7 shebangfix uniquefiles:dirs
+USES=        compiler:c++11-lib gettext pkgconfig python shebangfix uniquefiles:dirs
 USE_PYTHON=    autoplist distutils
 CFLAGS+=    -I${LOCALBASE}/include
The first line refers the file and svn revision. Lines with "-" and "+" indicate the modifications. In that simple case only "python:2.7" has been replaced by "python". This can easily be done by using an editor. The patch software can do this for you automatically.

You can play around with that with own simple examples as text files. Generate a file with 2-3 lines or so, make a copy and modify that. If the name are orig and copy diff -u orig copy will generate an output how to modify orig to be similar to copy. You can redirect the output to a file, for example mypatch. Then you can apply the patch as patch -i mypatch which will change the original file for you.

About the original problem, the line as above is already changed in the current Makefile. I am currently building the dependencies of math/numpy which includes devel/gcc6. This takes some time. I guess the original patch is obsolete. I will try to build math/matplotlib with the newest Makefile.
 
Dear akram65,
math/py-matplotlib has finished build. For doing to I have had to modify the Makefile as svnlite diff makefile shows.
Code:
/usr/ports/math/py-matplotlib$ svnlite diff Makefile
Index: Makefile
===================================================================
--- Makefile    (revision 455403)
+++ Makefile    (working copy)
@@ -27,7 +27,7 @@

 USE_GITHUB=    yes

-USES=          compiler:c++11-lib gettext pkgconfig python:2.7 shebangfix uniquefiles:dirs
+USES=          compiler:c++11-lib gettext pkgconfig python shebangfix uniquefiles:dirs
 USE_PYTHON=    autoplist distutils
 CFLAGS+=       -I${LOCALBASE}/include
Using an editor you just have to delete the four positions which bind the port to python27.

My options are not default but
Code:
---Begin Poudriere Port Flags/Env---
PORT_FLAGS=
PKGENV=
FLAVOR=py36
DEPENDS_ARGS=
MAKE_ARGS= FLAVOR=py36
---End Poudriere Port Flags/Env---

---Begin OPTIONS List---
===> The following configuration options are available for py36-matplotlib-1.5.3_3:
     EXAMPLES=off: Build and/or install examples
     GTKAGGBACKEND=off: GTKAgg backend support
     GTKBACKEND=off: GTK backend support
     QT4AGGBACKEND=off: Qt4Agg backend support
     QT5AGGBACKEND=off: Qt5Agg backend support
     TKAGGBACKEND=on: TKAgg backend support
     WXAGGBACKEND=off: WXAgg backend support
===> Use 'make config' to modify these settings
---End OPTIONS List---
If the non-default back-ends are acceptable for you it might be worth to give it a try. As far as I remember I have used the TkAgg back-end because it has the lowest amount on dependencies. I do not remember if there have been other issues with the other back-ends.
 
Thanks a lot for this. I successfully did the patching but am not able to make it for py36.
Well, I didn't understand this :


Code:
---Begin Poudriere Port Flags/Env---
PORT_FLAGS=
PKGENV=
FLAVOR=py36
DEPENDS_ARGS=
MAKE_ARGS= FLAVOR=py36
---End Poudriere Port Flags/Env---

---Begin OPTIONS List---
===> The following configuration options are available for py36-matplotlib-1.5.3_3:
EXAMPLES=off: Build and/or install examples
GTKAGGBACKEND=off: GTKAgg backend support
GTKBACKEND=off: GTK backend support
QT4AGGBACKEND=off: Qt4Agg backend support
QT5AGGBACKEND=off: Qt5Agg backend support
TKAGGBACKEND=on: TKAgg backend support
WXAGGBACKEND=off: WXAgg backend support
===> Use 'make config' to modify these settings
---End OPTIONS List---

How did you do this?
 
The text in the code block is just copied out of the ports-mgmt/poudriere log file. The options list is what you can change with make config. I am just not sure if it requires ports-mgmt/dialog4ports to get the dialog. With the patch and changed options it should be possible to build math/py-matplotlib.

One thing comes into my mind, have you defined the default python version? I think it should be defined in /etc/make.conf since you are using make as.
Code:
DEFAULT_VERSIONS+=python=3.6 python2=2.7 python3=3.6
 
Back
Top