how to add a python package to python39

VACCARI FRANCO vaccari at units.it
Fri Oct 15 00:05:14 UTC 2021


Marius,

thanks for looking into it! I took the updated Portfile and placed in my local tree, but got this error about @rpath/libgfortran.5.dylib missing

I have gcc10 and gcc11 installed, and compiled many fortran programs with gfortran 11 and they run properly. In /opt/local/lib/gcc11 I see this symbolic link

libgfortran.5.dylib -> /opt/local/lib/libgcc/libgfortran.5.dylib

but 

/opt/local/lib/libgcc/libgfortran.5.dylib

is not there, and I see instead

/opt/local/lib/libgcc/libgfortran.5.dylib.mp_1632812346 

so I’m not sure if something is wrong with my gcc installation. Maybe I should better delete and reinstall Macports, just to be sure. This is a test machine, so no risk of breaking anything (but I’m probably going off topic now…)

Anyway, I copy below the last part of py39-matplotlib-basemap/main.log

I've really appreciated your help!

Ciao

Franco


…
…
:info:build ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 2): Library not loaded: @rpath/libgfortran.5.dylib
:info:build   Referenced from: /opt/local/lib/libopenblas-r1.dylib
:info:build   Reason: image not found
:info:build During handling of the above exception, another exception occurred:
:info:build Traceback (most recent call last):
:info:build   File "/opt/local/var/macports/build/_Volumes_xHD_DMG_Users_miniadmin_Ports_python_py-matplotlib-basemap/py39-matplotlib-basemap/work/matplotlib-basemap-3076ec9/setup.py", line 19, in <module>
:info:build     import numpy
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 150, in <module>
:info:build     from . import core
:info:build   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/__init__.py", line 48, in <module>
:info:build     raise ImportError(msg)
:info:build ImportError: 
:info:build IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
:info:build Importing the numpy C-extensions failed. This error can happen for
:info:build many reasons, often due to issues with your setup or how NumPy was
:info:build installed.
:info:build We have compiled some common reasons and troubleshooting tips at:
:info:build     https://numpy.org/devdocs/user/troubleshooting-importerror.html
:info:build Please note and check the following:
:info:build   * The Python version is: Python3.9 from "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9"
:info:build   * The NumPy version is: "1.21.2"
:info:build and make sure that they are the versions you expect.
:info:build Please carefully study the documentation linked above for further help.
:info:build Original error was: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 2): Library not loaded: @rpath/libgfortran.5.dylib
:info:build   Referenced from: /opt/local/lib/libopenblas-r1.dylib
:info:build   Reason: image not found
:info:build Command failed:  cd "/opt/local/var/macports/build/_Volumes_xHD_DMG_Users_miniadmin_Ports_python_py-matplotlib-basemap/py39-matplotlib-basemap/work/basemap-1.2.2" && /opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 setup.py --no-user-cfg build -j8 
:info:build Exit code: 1
:error:build Failed to build py39-matplotlib-basemap: command execution failed
:debug:build Error code: CHILDSTATUS 6668 1
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_Volumes_xHD_DMG_Users_miniadmin_Ports_python_py-matplotlib-basemap/py39-matplotlib-basemap/main.log for details.



> On 14 Oct 2021, at 23:27, Marius Schamschula <lists at schamschula.com> wrote:
> 
> Franco,
> 
> I just found a workaround for this issue, and committed an updated Portfile
> 
> https://github.com/macports/macports-ports/commit/0b17692041f0cac2a1ae588e0a22161a39e72106
> 
> Marius
> --
> Marius Schamschula
> 
> 
> 
> 
>> On Oct 14, 2021, at 8:11 AM, VACCARI FRANCO <vaccari at units.it> wrote:
>> 
>> Ok, will look at the guide for portindex use
>> 
>> Thanks again
>> 
>> Franco
>> 
>>> On 14 Oct 2021, at 15:07, Marius Schamschula <lists at schamschula.com> wrote:
>>> 
>>> Franco,
>>> 
>>> You have to run
>>> 
>>> portindex
>>> 
>>> to add the support to the index.
>>> 
>>> Marius
>>> --
>>> Marius Schamschula
>>> 
>>> 
>>> 
>>> 
>>>> On Oct 14, 2021, at 7:58 AM, VACCARI FRANCO <vaccari at units.it> wrote:
>>>> 
>>>> Ok, thanks anyway for the not-so-good news… ;-)
>>>> 
>>>> But out of curiosity, from my experiments I learned that simply adding 39 to 
>>>> 
>>>> /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/python/py-matplotlib-basemap/Portfile
>>>> 
>>>> does not automagically allow to try 
>>>> 
>>>> sudo port install py39-matplotlib-basemap (Error: Port py39-matplotlib-basemap not found)
>>>> 
>>>> What else should I do to finally be able to see the build fail?
>>>> 
>>>> Franco 
>>>> 
>>>>> On 14 Oct 2021, at 14:47, Marius Schamschula <lists at schamschula.com> wrote:
>>>>> 
>>>>> Franco,
>>>>> 
>>>>> Yes, you would need to add 39.
>>>>> 
>>>>> As py-matplotlib-basemap has no maintainer, this has apparently been missed.
>>>>> 
>>>>> However, when trying to build py39-matplotlib-basemap you will see several errors:
>>>>> 
>>>>> error: no member named 'tp_print' in 'struct _typeobject’
>>>>> 
>>>>> This is no longer supported in Python 3.9. There is no easy workaround to this.
>>>>> 
>>>>> Marius
>>>>> --
>>>>> Marius Schamschula
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Oct 14, 2021, at 7:31 AM, VACCARI FRANCO <vaccari at units.it> wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I’m going to experiment with python on a new M1 MacMini and installed python39 and most of the packages needed by instaseis
>>>>>> 
>>>>>> <https://instaseis.net>
>>>>>> 
>>>>>> I’m getting in trouble with matplotlib-basemap. I see several versions listed but not the one for python39. If I look at the version for python38
>>>>>> 
>>>>>> port file py38-matplotlib-basemap 
>>>>>> 
>>>>>> points me to /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/python/py-matplotlib-basemap/Portfile
>>>>>> 
>>>>>> and inside that I see this entry
>>>>>> 
>>>>>> python.versions     27 35 36 37 38
>>>>>> 
>>>>>> How to add compatibility with python39 to it? It looks like it’s not just a matter of adding 39 there... How could I create the py39matplotlib-basemap package?
>>>>>> 
>>>>>> Sorry for what is very likely a dumb question...
>>>>>> 
>>>>>> Franco
>>>>> 
>>>> 
>>> 
>> 
> 



More information about the macports-users mailing list