# python36: compilation problem with readline.so



## ArnTA (Jun 5, 2019)

After upgrading from FreeBSD 10.3 to 11.2, I am rebuilding ports. There is a problem to compile python36 which is needed by several ports.
It is about readline. The readline-8.0.0 package is installed.
Below message related during "make install" of the port.
It seems many persons met the same problem with python27. But I don't find or understand the resolution.

```
cc -shared -lpthread -L/usr/local/lib -fstack-protector-strong -lpthread -L/usr/local/lib -fstack-protector-strong -O2 -pipe -fsta
ck-protector-strong -fno-strict-aliasing -I/usr/local/include -I/usr/local/include build/temp.freebsd-11.2-RELEASE-p10-amd64-3.6/u
sr/ports/lang/python36/work/Python-3.6.8/Modules/readline.o -L/usr/lib/termcap -L. -L/usr/local/lib -lreadline -lpython3.6m -o bui
ld/lib.freebsd-11.2-RELEASE-p10-amd64-3.6/readline.so^M

*** WARNING: renaming "readline" since importing it failed: build/lib.freebsd-11.2-RELEASE-p10-amd64-3.6/readline.so: Undefined symbol "rl_callback_sigcleanup"
...
Following modules built successfully but were removed because they could not be imported:
readline
...
copying build/lib.freebsd-11.2-RELEASE-p10-amd64-3.6/readline_failed.so -> /usr/ports/lang/python36/work/stage/usr/local/lib/python3.6/lib-dynload
...
===>  Checking if python36 is already installed^M
actual-package-depends: dependency on /lib/libreadline.so.8 not registered (normal if it belongs to base)
===>   Registering installation for python36-3.6.8_2
pkg-static: Unable to access file /usr/ports/lang/python36/work/stage/usr/local/lib/python3.6/lib-dynload/readline.so:No such file
or directory^M
*** Error code 74
```
Does anyone have any suggestions?  Thank you.


----------



## SirDice (Jun 5, 2019)

Is there a particular reason why you need ports? This might be a good opportunity to switch to using packages.


----------



## ArnTA (Jun 5, 2019)

I have some ports, I dont remember exactly how many, with special options.
In this case,I have installed python36 package, OK. 
But when when I install the dependent ports as bind911 with portmaster, it reinstall python36 with the port.
I notice package use readline-7.x.x as port want readline-8.0.0


----------



## SirDice (Jun 5, 2019)

Note that /lib/libreadline.so.8 is part of the base OS, not a package. 



ArnTA said:


> I notice package use readline-7.x.x as port want readline-8.0.0


Switch to the latest packages. The devel/readline port was updated to 8.0 after the quarterly branch was made.


----------



## ArnTA (Jun 6, 2019)

SirDice said:


> Note that /lib/libreadline.so.8 is part of the base OS, not a package.


Thank you for the hint. I not sure to understand why python36 depends on readline-8.0.0 and need the base OS /lib/libreadline.so.8, but it doesn't matter.
About my issue, I see that I have 2 libreadline.so.

```
# ll /lib/libreadline*
-r--r--r--  1 root  wheel  248800 Jan  1  2009 /lib/libreadline.so.7
-r--r--r--  1 root  wheel  273064 Aug 29  2016 /lib/libreadline.so.8
```
 And on a similar server I update to 11.2 six month ago there is only /lib/libreadline.so.7. So after moving away libreadline.so.8, python36 is compliling and I can reinstall all the ports and achieve update to 11.2.

Strangely, on the last `freebsd-update install`of the update process I have the message:

```
Installing updates...rm: ///lib/libreadline.so.8: No such file or directory
```


----------



## mstrofbass (Jan 15, 2020)

Just a heads up: I ran into this same issue when trying to upgrade from like 10.2 to 12.1, but it occurred with python37. I couldn't figure out which port was needing it (so I could remove the port and switch to the pkg version) or how to get it to use a binary install of python37. Thanks to this thread (which I passed over previously), I also moved `/lib/libreadline.so.8` out of the lib folder and it worked.

This may be obvious to other people, but to clarify anyways, in my case I didn't have `/lib/libreadline.so.7` so the problem does not appear to depend on its presence.


----------



## Sectordan (Oct 16, 2020)

mstrofbass said:


> Just a heads up: I ran into this same issue when trying to upgrade from like 10.2 to 12.1, but it occurred with python37. I couldn't figure out which port was needing it (so I could remove the port and switch to the pkg version) or how to get it to use a binary install of python37. Thanks to this thread (which I passed over previously), I also moved `/lib/libreadline.so.8` out of the lib folder and it worked.
> 
> This may be obvious to other people, but to clarify anyways, in my case I didn't have `/lib/libreadline.so.7` so the problem does not appear to depend on its presence.


FreeBSD **** 11.4-RELEASE-p4 FreeBSD 11.4-RELEASE-p4 #0 r366664
pkg-static: Unable to access file /usr/ports/lang/python37/work/stage/usr/local/lib/python3.7/lib-dynload/readline.so:No such file or directory

Thank's you save my time.


----------

