Solved Can't build devel/py-setuptools

Built fine here just today.

Something is borked with your system. Use poudriere, it will spare you a lot of hassle (or, use binary packages directly ...)
 
I made a fresh 13.1 installation and py-setuptools installation complete successfully.

But what can be broken in my other system and it doesn't work?

Only these ports were needed and I have the same ports options on both systems:

Code:
gettext-tools
gmake
libtextstyle
pkgconf
readline
python39
math_mpdecimal
 
But what can be broken in my other system and it doesn't work?
When you're building in your live system (and this is the case when using the ports tree directly as well as when using portmaster and similar utilities), the possibilities are endless.

If you really need to build yourself, I really really recommend using poudriere. Building in a clean isolated environment (poudriere uses jails for that) avoids a hell of a lot of possible error conditions.
 
Try removing Python 3.x and re-building.

Check /usr/ports/UPDATING to make sure you've not missed any Python steps in the past.

You may have to work through dependencies and clean/rebuild until you find the issue.
 
I tried to rebuild all ports using portmaster --no-confirm -a -f -D but it failed when it tried to build py-setuptools. Now I install py-setuptools using pkg and I will try to rebuild everything.
 
Finally this is how I fix it:

pkg install py-setuptools
portmaster --no-confirm -y libimagequant


Now these commands work:

cd /usr/ports/devel/py-setuptools && make install clean

I will also rebuild all ports to make sure everything is fine.
 
I think we'll all end up on poudriere (or using binary packages) but the times I've looked it has seemed so complicated (to me!) compared to portsnap/portmaster. Yes, I understand poudriere has lots of good stuff but 99% of the time I type a couple of portsnap/portmaster commands and job done (and that's been the case for over a decade.)

For anyone new to FreeBSD - don't start with portsnap/portmaster - it's not recommended (because of issues like the issues causing this thread to be raised amongst other things).
 
I have again the same issue when I try to build py-setuptools :

Code:
===>   py39-setuptools-63.1.0 depends on file: /usr/local/bin/python3.9 - found
===>   Returning to build of py39-setuptools-63.1.0
===>  Configuring for py39-setuptools-63.1.0
Traceback (most recent call last):
  File "/usr/ports/devel/py-setuptools/work-py39/setuptools-63.1.0/setup.py", line 7, in <module>
    import setuptools
  File "/usr/ports/devel/py-setuptools/work-py39/setuptools-63.1.0/setuptools/__init__.py", line 18, in <module>
    from setuptools.dist import Distribution
  File "/usr/ports/devel/py-setuptools/work-py39/setuptools-63.1.0/setuptools/dist.py", line 34, in <module>
    from ._importlib import metadata
  File "/usr/ports/devel/py-setuptools/work-py39/setuptools-63.1.0/setuptools/_importlib.py", line 39, in <module>
    disable_importlib_metadata_finder(metadata)
  File "/usr/ports/devel/py-setuptools/work-py39/setuptools-63.1.0/setuptools/_importlib.py", line 28, in disable_importlib_metadata_finder
    to_remove = [
  File "/usr/ports/devel/py-setuptools/work-py39/setuptools-63.1.0/setuptools/_importlib.py", line 31, in <listcomp>
    if isinstance(ob, importlib_metadata.MetadataPathFinder)
AttributeError: module 'importlib_metadata' has no attribute 'MetadataPathFinder'
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/py-setuptools

My system doesn't have anything related to python installed. It just do fresh builds for py-setuptools dependencies. So how it's possible the py-setuptools build to fail?
 
Yes it's something specific with my system but I don't understand how it's possible the build to fail. As I said before doing "make install clean" my system doesn't have any py39-* or python39-* packages installed.
 
There are no python packages already installed.

/etc/make.conf :

Code:
OPTIONS_UNSET=X11
DEFAULT_VERSIONS+=php=81
DEFAULT_VERSIONS+=ssl=openssl
 
... which hints there is something left on your system that now causes some trouble. You could now try and manually find/delete any python-3.9 leftovers...

It's still a perfect example for why poudriere builds everything in a clean (freshly created) jail.
 
Without python installed I found these files:

Code:
/usr/local/lib/python3.9
/usr/local/lib/python3.9/site-packages/pyximport
/usr/local/lib/python3.9/site-packages/pyximport/__pycache__/pyximport.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/pyximport/__pycache__/pyxbuild.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/pycparser
/usr/local/lib/python3.9/site-packages/sphinx/domains/__pycache__/python.cpython-39.opt-1.pyc
/usr/local/lib/python3.9/site-packages/sphinx/domains/__pycache__/python.cpython-39.pyc
/usr/local/lib/python3.9/site-packages/sphinx/domains/__pycache__/python.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/sphinx/__pycache__/pygments_styles.cpython-39.pyc
/usr/local/lib/python3.9/site-packages/sphinx/__pycache__/pygments_styles.cpython-39.opt-1.pyc
/usr/local/lib/python3.9/site-packages/sphinx/__pycache__/pygments_styles.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/sphinx/util/__pycache__/pycompat.cpython-39.opt-1.pyc
/usr/local/lib/python3.9/site-packages/sphinx/util/__pycache__/pycompat.cpython-39.pyc
/usr/local/lib/python3.9/site-packages/sphinx/util/__pycache__/pycompat.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/sphinx/pycode
/usr/local/lib/python3.9/site-packages/mesonbuild/modules/__pycache__/python3.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/mesonbuild/modules/__pycache__/python.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing
/usr/local/lib/python3.9/site-packages/urllib3/contrib/__pycache__/pyopenssl.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/pyproject_hooks
/usr/local/lib/python3.9/site-packages/docutils/writers/odf_odt/__pycache__/pygmentsformatter.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/setuptools/__pycache__/py34compat.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/setuptools/command/__pycache__/py36compat.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/setuptools/_vendor/pyparsing
/usr/local/lib/python3.9/site-packages/setuptools/_distutils/__pycache__/py39compat.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/setuptools/_distutils/__pycache__/py38compat.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/__pycache__/py37compat.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/setuptools/config/__pycache__/pyprojecttoml.cpython-39.opt-2.pyc
/usr/local/lib/python3.9/site-packages/pytz
/usr/local/lib/python3.9/site-packages/pygments
/usr/local/lib/python3.9/site-packages/pygments/lexers/__pycache__/python.cpython-39.opt-2.pyc

I will remove them and try again.
 
And finally /usr/local/lib/python3.9 was the problem.

I believe a previous python 3.9.x deinstall didn't remove these files which cause a conflict during a new python 3.9.x installation.

Now after a python 3.9 the /usr/local/lib/python3.9 is removed automatically.
 
Back
Top