# Trouble with Python and postfix-policyd-spf-python



## PetriR (Jan 21, 2016)

I used to have postfix-policyd-spf-python working fine with my FreeBSD 9.3 box and Python 2.7. Then some update introduced py3dns to the mix and my setup broke, since py3dns requires Python 3. Well, I thought, I'll update Python while I am at it. I can't get it to work. My Python appears to be working fine with version 3.5, but the original reason for using it doesn't install. The shortest example of the error looks like:


```
[root /usr/ports/mail/postfix-policyd-spf-python]# make install
===>  Installing for py35-postfix-policyd-spf-python-1.3.2_1
===>   py35-postfix-policyd-spf-python-1.3.2_1 depends on package: py35-ipaddr>0 - found
===>   py35-postfix-policyd-spf-python-1.3.2_1 depends on package: py35-pyspf>0 - found
===>   py35-postfix-policyd-spf-python-1.3.2_1 depends on package: py35-authres>0 - found
===>   py35-postfix-policyd-spf-python-1.3.2_1 depends on package: py35-setuptools35>0 - found
===>   py35-postfix-policyd-spf-python-1.3.2_1 depends on file: /usr/local/bin/python3.5 - found
===>  Checking if py35-postfix-policyd-spf-python already installed
===>   Registering installation for py35-postfix-policyd-spf-python-1.3.2_1
pkg-static: Unable to access file /usr/ports/mail/postfix-policyd-spf-python/work/stage/usr/local/lib/python3.5/site-packages/policydspfsupp.pyo: No such file or directory
pkg-static: Unable to access file /usr/ports/mail/postfix-policyd-spf-python/work/stage/usr/local/lib/python3.5/site-packages/policydspfsupp.pyc: No such file or directory
pkg-static: Unable to access file /usr/ports/mail/postfix-policyd-spf-python/work/stage/usr/local/lib/python3.5/site-packages/policydspfuser.pyo: No such file or directory
pkg-static: Unable to access file /usr/ports/mail/postfix-policyd-spf-python/work/stage/usr/local/lib/python3.5/site-packages/policydspfuser.pyc: No such file or directory
*** [fake-pkg] Error code 74

Stop in /usr/ports/mail/postfix-policyd-spf-python.
*** [install] Error code 1

Stop in /usr/ports/mail/postfix-policyd-spf-python.
```

The policydspfsupp and policydspfuser .pyo and .pyc files are not there, but the .py files are. I have understood the .pyo is no longer used with Python 3.5.

Here is my current list of installed Python related ports:

```
py35-authres-0.800
py35-ipaddr-2.1.11
py35-py3dns-3.1.0
py35-pyspf-2.0.12_3
py35-setuptools35-19.2
python-3.5_2,2
python3-3_3
python35-3.5.1_1
```


----------



## kpa (Jan 21, 2016)

Have you set the default python version to 3.5 in your /etc/make.conf? There should be a line like:


```
DEFAULT_VERSIONS += python=3.5
```


----------



## PetriR (Jan 21, 2016)

Thanks kpa! Yes, I have

```
DEFAULT_VERSIONS= ruby=2.3 python=3.5
```


----------

