# Problem with 2 versions of python



## HL1234 (May 4, 2014)

Hello,
because FreeBSD 10 has lost his name-server bind (my bind97 was gone after an upgrade to FreeBSD 10) I decide to install bind10 (the latest now).

I have got the error:

```
bind10-1.2.0 You have python 2.7 set as the default, and this needs 3.3.[/quote]
I get python27, thats right  - so I install python33 beside python27, but I got the error again:
 [quote]bind10-1.2.0 You have python 2.7 set as the default, and this needs 3.3.[/quote]
Next I set this, as I reading here, in make.conf [code]DEFAULT_VERSIONS=python=3.3
```
And now I beginns do compile:
`cd /usr/ports/dns/bind10`
`make build` 
but it recommends some other ports: boost-libs-1.55.0_1, botan110-1.10.7,..
in botan110-1.10.7 it stops!
`cd /usr/ports/security/botan110`
`make build`  is OK, but
`make install` give this error:


> ===>  Staging for botan110-1.10.7
> ===>   botan110-1.10.7 depends on file: /usr/local/lib/libcrypto.so.8 - found
> ===>   botan110-1.10.7 depends on shared library: gmp - found
> ===>   Generating temporary packing list
> ...


----------



## kpa (May 4, 2014)

This is clearly a bug in the new BIND 10 port. If it does need Python 3.3 then the port itself should set the required Python version in its Makefile and not use the system default. File a PR.


----------



## HL1234 (May 4, 2014)

I have make (my first  problem report. But this do not fix the problem with the 2 Python versions.


----------



## kpa (May 4, 2014)

The two versions is something you just have to live with and having them both installed doesn't cause any problems really. There's tons and tons of software that has been written for Python 2 that can not be easily migrated to Python 3, that's why you can't get rid of Python 2 just yet.


----------



## HL1234 (May 4, 2014)

Hello,
Thank you for your answer. I have no experience with python, more with perl, php...


			
				kpa said:
			
		

> The two versions is something you just have to live with and having them both installed doesn't cause any problems really.


How can I do that? 
And how do I fix the error with security/botan110?

```
ImportError: No module named pkg_resources
gmake[2]: *** [docs] Fehler 1
gmake[2]: Leaving directory `work/Botan-1.10.7'....*** Error code 2
```
This is my actual installation status: `pkg info | grep py`

```
py27-Babel-1.3_1               Collection of tools for internationalizing Python applications
py27-Jinja2-2.7.2_1            Fast and easy to use stand-alone template engine
py27-MarkupSafe-0.21           Implements a XML/HTML/XHTML Markup safe string for Python
py27-docutils-0.11             Python Documentation Utilities
py27-gdbm-2.7.6_2              Python bindings to the GNU dbm library
py27-libxml2-2.8.0_2           Python interface for XML parser library for GNOME
py27-pygments-1.6_2            Syntax highlighter written in Python
py27-pytz-2014.1.1,1           World Timezone Definitions for Python
py27-sphinx-1.2.2              Python documentation generator
py33-setuptools33-2.0.1        Python packages installer
py33-sqlite3-3.3.5_3           Standard Python binding to the SQLite3 library
python2-2_2                    The "meta-port" for version 2 of the Python interpreter
python27-2.7.6_4               Interpreted object-oriented programming language

python3-3_1                    The "meta-port" for version 3 of the Python interpreter
python33-3.3.5_1               Interpreted object-oriented programming language
```


----------



## trh411 (May 4, 2014)

HL1234 said:
			
		

> And how do I fix the error with security/botan110?


Are you sure you are working with the latest version in your ports tree? I just successfully installed security/botan110 on FreeBSD-10.0, so there is nothing wrong with the port itself.


----------



## HL1234 (May 5, 2014)

yes, I had make 2 days before clean all ports and install them new:

```
rm /var/db/portsnap/tag
rm -rf /var/db/portsnap/files
rm -rf /usr/ports/*
cd /usr/ports
portsnap fetch
portsnap extract update
```
In between time I found this disscussion which describes my problem very good:
http://freebsd.1045724.n5.nabble.com/Dealing-with-2-7-and-3-3-installations-td5832223.html
But I don't know how I could solve that when I only use the ports without any tricks.


----------



## HL1234 (May 5, 2014)

Hi,
I have get bind10 now compiled and installed. This is I have done:
I deinstalled lang/python33 
I installed lang/python34 (the latest) and reinstall lang/python27
and
in dns/bind10 I give the command
`make DEFAULT_VERSIONS=python=3.4`
It breaks again at py-setuptools.
I go to devel/py-setuptools34 and do
`make install DEFAULT_VERSIONS=python=3.4`

in dns/bind10 again
`make DEFAULT_VERSIONS=python=3.4`
It breaks again for botan110-1.10.7
I install botan110-1.10.7 via the packages:
`pkg install botan110-1.10.7`

in dns/bind10 again
`make DEFAULT_VERSIONS=python=3.4`
...
error "/usr/local/bin/python3.4-config is not present..."
But there is a file: /usr/local/bin/python3.4m-config - I copy it
`cp /usr/local/bin/python3.4m-config   /usr/local/bin/python3.4-config`

in dns/bind10 again
`make DEFAULT_VERSIONS=python=3.4`
==>OK!
`make install DEFAULT_VERSIONS=python=3.4`
==OK!

bind10 now installed, but it seems to me, that there is nothing integrated with the freeBSD concept. I mean I can not start it. Whether in /etc/rc.d or in /usr/local/etc/rc.d is any start script nor I can't find any *.conf files for bind10 in ../etc. It looks like there is a lot of new stuff for me to learn before I can configure it.

There is help in `less /usr/local/share/doc/bind10/bind10-guide.txt`

Thanks all for having try help me.
Harald


----------



## kpa (May 5, 2014)

The rc(8) and the configuration files live under /usr/local/etc now. Starting with FreeBSD 10 BIND has been removed from base and the port versions of it install under the standard LOCALBASE which is /usr/local.


----------



## wmoreno3 (May 12, 2014)

Thanks HL1234 your work make me easy to fix my problem, that I have had some days:
-------------------------------------------------------------------------------------------------------------------

```
20140503:
  AFFECTS: users of science/hdf5* and science/netcdf*
  AUTHOR: sunpoet@FreeBSD.org

  There are major version changes in HDF5 and NetCDF ports:
  - science/hdf5: updated from 1.6.9 to 1.8.12
...skipping...
  DEFAULT_VERSIONS=python=2.7 python2=2.7 python3=3.3
```
-------------------------------------------------------------------------------------------------------------------
I suggest that install python 3.4 and 2.7 and make as default "`DEFAULT_VERSIONS=python=3.4`" in "`/etc/make.conf`"
in order to eliminate conflits with "py-setuptools" installs python as follow:

```
cd /usr/ports/lang/python34/
make clean config install
cd /usr/ports/devel/py-setuptools34/
make clean config install
cd /usr/ports/lang/python27/
make clean config install
cd /usr/ports/devel/py-setuptools27/
make clean config install
```
Note: make deinstall and reinstall if needed 
-------------------------------------------------------------------------------------------------------------------
`pkg info -ix py`

```
py27-setuptools27-2.0.1
py34-setuptools34-2.0.1
python27-2.7.6_4
python34-3.4.0
```
-----------------------------------------------

```
cd /usr/ports/security/botan110/
make clean config install
```
-----------------------------------------------
then "`cd /usr/ports/dns/bind10/`" and install
when an error:

```
configure: WARNING: /usr/local/bin/python3.4-config does not exist or is not executable ...
```
`cp /usr/local/bin/python3.4dm-config /usr/local/bin/python3.4-config` (my case) and install again
`pkg info -ix bind`

```
bind10-1.2.0
```
-----------------------------------------------


----------



## Jimmy (May 21, 2014)

I also submitted a problem report for this.  As I've hit this issue on top of all of the -- without exaggeration -- multitude of bugs, issues or annoyances I've encountered when upgrading to 10.0-RELEASE.

But it was fixable by using the make parameter specified above. Even after removing all of the python 2.7 packages and checking no reference to default versions in env or make.conf without the make parameter specified above the bind10 port would deploy python 2.7 itself, then complain that the wrong version of python was present!

You'd think this particular port would be QA tested since they have removed BIND from the base.


----------



## junovitch@ (May 22, 2014)

Why not use dns/bind98, dns/bind99, or dns/bind910?  They are the successors of the BIND you used in base.  I haven't had any issues there.  BIND 10 is a fundamental re-write of BIND and is pretty much a whole different software package.  Install any of the 9 series and you can use the configuration files and knowledge you already have.


----------



## wmoreno3 (May 22, 2014)

Because I have had several problems with bind10, I decided to uninstall bind10 and install bind910 instead, bind910 has not problem with python27, python3 the "meta-port" or python34.
My system

```
# uname -a
FreeBSD mydomain 10.0-RELEASE-p3 FreeBSD 10.0-RELEASE-p3 #0: Tue May 13 18:31:10 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
```
My python files installed with no conflicts

```
py27-setuptools27-2.0.1        Python packages installer
py34-setuptools34-2.0.1        Python packages installer
py34-sqlite3-3.4.0_3           Standard Python binding to the SQLite3 library
python27-2.7.6_4               Interpreted object-oriented programming language
python3-3_1                    The "meta-port" for version 3 of the Python interpreter
python34-3.4.0                 Interpreted object-oriented programming language
```
bind installed

```
bind910-9.10.0.1_2             BIND DNS suite with updated DNSSEC and DNS64
```


----------

