# Trouble with flavors again



## Aknot (May 15, 2020)

I'm getting this when running portmaster:


```
===>>> All >> py27-sphinxcontrib-websupport-1.1.2 (1/17)
===>  Cleaning for py27-sphinxcontrib-websupport-1.2.2
===>  py27-sphinxcontrib-websupport-1.2.2 Unknown flavor 'py27', possible
flavors: py37.
*** Error code 1
Stop.
make: stopped in /usr/ports/textproc/py-sphinxcontrib-websupport
```

Can I safely remove py27, and only use py37?

Thanks,


----------



## SirDice (May 15, 2020)

As far as I know Python 2.7 is still used as a build dependency on a few ports. The number of ports that have a run dependency on 2.7 is probably quite small now but there may still be a few that need it. Only you can tell if it's still required for something you have installed. Have you tried just deleting it and seeing what else might get removed too?


----------



## Aknot (May 15, 2020)

Checked it right now, and it was a bunch of ports using py27, it's not possible to remove that version.


----------



## SirDice (May 15, 2020)

Alldo said:


> an it was a bunch of ports using py27


Which ones? You may just need to update those.


----------



## Aknot (May 15, 2020)

cmake and portmaster among others, going to test update just those


----------



## Aknot (May 15, 2020)

Doesn't work, all problems seems to be related to textproc/py-sphinxcontrib-*
Don't know how to continue.

```
Upgrade py27-sphinxcontrib-websupport-1.1.2 to py27-sphinxcontrib-websupport-1.2.2
Upgrade py27-sphinx-1.6.5_2,1 to py27-sphinx-3.0.2,1
Install textproc/py-sphinxcontrib-applehelp@py27
Install textproc/py-sphinxcontrib-devhelp@py27
Install textproc/py-sphinxcontrib-htmlhelp@py27
Install textproc/py-sphinxcontrib-jsmath@py27
Install textproc/py-sphinxcontrib-qthelp@py27
Install textproc/py-sphinxcontrib-serializinghtml@py27
```

All ports above gives error:

```
Unknown flavor 'py27', possible flavors: py37.
*** Error code 1
```


----------



## memreflect (May 15, 2020)

You might want to try building textproc/py-sphinxcontrib-websupport@py37 explicitly; it's possible your system is defaulting to @py27 for some reason.  If that works, I would check /etc/make.conf for any lines that set Python's default version to 2.7.  Just don't set python2=3.7. I'm sure you can guess the problems that would cause.


----------



## SirDice (May 15, 2020)

What's in your /etc/make.conf (if you have it)?


----------



## Minbari (May 15, 2020)

python2.7 is a dependency of node/firefox so until it is removed as a dependency it will exist on your system, but others python programs can migrate to newer version. I upgraded mine to python3.8.
Add the following to /etc/make.conf


```
DEFAULT_VERSIONS += python=3.8 python3=3.8
```


----------



## Lamia (May 15, 2020)

'pkg info aq | grep -i py27' should show you all py27 pkgs. You could then copy them, change py27 to py36 and remove the minor version decimal numbers suffixed to each package. Lastly, install all. While that will upgrade all py27 pkgs, some other pkgs requiring only ver2.7 as dependencies might consequently be broken. 
You can then run 'pkg upgrade' to fix the broken pkgs. Try not to mix ports with pkgs. If you do, be careful.


----------



## Aknot (May 16, 2020)

SirDice said:


> What's in your /etc/make.conf (if you have it)?



This is what I have in make.conf


```
DEFAULT_VERSIONS+=perl5=5.30
WITHOUT_X11=yes
WITHOUT_X=yes
```


----------



## Aknot (May 16, 2020)

memreflect said:


> You might want to try building textproc/py-sphinxcontrib-websupport@py37 explicitly; it's possible your system is defaulting to @py27 for some reason.  If that works, I would check /etc/make.conf for any lines that set Python's default version to 2.7.  Just don't set python2=3.7. I'm sure you can guess the problems that would cause.


I'm using portmaster, do I need to set make FLAVOR inside each sphinxcontrib ports directory?


----------



## Aknot (May 16, 2020)

Minbari said:


> python2.7 is a dependency of node/firefox so until it is removed as a dependency it will exist on your system, but others python programs can migrate to newer version. I upgraded mine to python3.8.
> Add the following to /etc/make.conf
> 
> ```
> ...



I'm using portmaster, what do I need to run afterwords to reinstall all ports to use the new version?


----------



## Aknot (May 16, 2020)

Lamia said:


> 'pkg info aq | grep -i py27' should show you all py27 pkgs. You could then copy them, change py27 to py36 and remove the minor version decimal numbers suffixed to each package. Lastly, install all. While that will upgrade all py27 pkgs, some other pkgs requiring only ver2.7 as dependencies might consequently be broken.
> You can then run 'pkg upgrade' to fix the broken pkgs. Try not to mix ports with pkgs. If you do, be careful.




This is what I get:


```
py27-Babel-2.8.0
py27-Jinja2-2.10.1
py27-MarkupSafe-1.1.1
py27-alabaster-0.7.6
py27-asn1crypto-1.3.0
py27-certifi-2020.4.5.1
py27-cffi-1.14.0
py27-chardet-3.0.4_3
py27-cryptography-2.6.1
py27-cython-0.29.15
py27-docutils-0.15.2
py27-enum34-1.1.6
py27-idna-2.8
py27-imagesize-1.1.0
py27-ipaddress-1.0.23
py27-openssl-19.0.0
py27-packaging-20.3
py27-pycparser-2.19
py27-pygments-2.5.2
py27-pyparsing-2.4.7
py27-pysocks-1.7.1
py27-pystemmer-2.0.0.1
py27-pytest-runner-2.11.1
py27-pytz-2020.1,1
py27-requests-2.22.0
py27-setuptools-44.0.0
py27-setuptools_scm-3.4.3
py27-six-1.14.0
py27-snowballstemmer-1.2.1
py27-sphinx-1.6.5_2,1
py27-sphinx_rtd_theme-0.4.3
py27-sphinxcontrib-websupport-1.1.2
py27-toml-0.10.0
py27-typing-3.7.4.1
py27-urllib3-1.25.7,1
```


----------



## Lamia (May 16, 2020)

```
pkg delete -f py27-Babel-2.8.0py27-Jinja2-2.10.1py27-MarkupSafe-1.1.1py27-alabaster-0.7.6py27-asn1crypto-1.3.0py27-certifi-2020.4.5.1py27-cffi-1.14.0py27-chardet-3.0.4_3py27-cryptography-2.6.1py27-cython-0.29.15py27-docutils-0.15.2py27-enum34-1.1.6py27-idna-2.8py27-imagesize-1.1.0py27-ipaddress-1.0.23py27-openssl-19.0.0py27-packaging-20.3py27-pycparser-2.19py27-pygments-2.5.2
pkg install py37-Babel py37-Jinja2-2.10.1py37-MarkupSafe   py37-alabaster  py37-asn1crypto py37-certifi py37-cffi py37-chardet py37-cryptography py37-cython py37-docutils py37-enum34 py37-idna py37-imagesize py37-ipaddress py37-openssl py37-packaging py37-pycparser  py37-pygments
pkg upgrade
```

Py37 is more stable than Py38.


----------



## Aknot (May 16, 2020)

Lamia said:


> ```
> pkg delete -f py27 ...
> pkg install py37 ...
> pkg upgrade ...
> ...


Thanks,

All the ports are installed and maintained using `portmaster`, can I safely deinstall and upgrade ports using `pkg` instead?


----------



## Minbari (May 16, 2020)

Alldo said:


> I'm using portmaster, what do I need to run afterwords to reinstall all ports to use the new version?


I'm also using portmaster to install maintain my system. So you only need to run portmaster.



Alldo said:


> Thanks,
> All the ports are installed and maintained using `portmaster`, can I safely deinstall and upgrade ports using `pkg` instead?


You can uninstall them using pkg but you need to reinstall them with portmaster (which make from a port a package). Don't mix ports and packages, you'll end up with a broken system.



Lamia said:


> Py37 is more stable than Py38.



"There are now *newer bugfix releases* of Python 3.7 that supersede 3.7.0 and Python 3.8 is now the *latest feature release* of Python 3.  Get the latest releases of 3.7.x and 3.8.x here.  We plan to continue to provide _bugfix releases_ for 3.7.x *until mid 2020* and _security fixes_ until mid 2023."


----------



## Lamia (May 16, 2020)

Minbari said:


> You can uninstall them using pkg but you need to reinstall them with portmaster (which make from a port a package). Don't mix ports and packages, you'll end up with a broken system.


You should do that - use portmaster.


----------



## Aknot (May 18, 2020)

Thanks all for your help, much appreciated 

Shouldn't I run `portmaster -o lang/python27 lang/python37` after uninstalling `py27*` and adding `DEFAULT_VERSIONS += python=3.7 python3=3.7` to `/etc/make.conf`?


----------



## Lamia (May 18, 2020)

Alldo said:


> Thanks all for your help, much appreciated
> 
> Shouldn't I run `portmaster -o lang/python27 lang/python37` after uninstalling `py27*` and adding `DEFAULT_VERSIONS += python=3.7 python3=3.7` to `/etc/make.conf`?


You can do that but it won't install all the packages above just python37.


----------

