<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="setup.py build
setup.py install -root &lt;/install/prefixx&gt;
PYTHONPATH=&lt;/install/prefix/sitearch&gt;.pytest"><pre class="notranslate"><span class="pl-c1">setup.py build</span>
<span class="pl-c1">setup.py install -root &lt;/install/prefixx&gt;</span>
<span class="pl-c1">PYTHONPATH=&lt;/install/prefix/sitearch&gt;.pytest</span></pre></div>
<p dir="auto">And here is pytest output</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages
+ PYTHONDONTWRITEBYTECODE=1
+ xvfb-run -a -s '-screen 0 640x480x24' /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2, configfile: pytest.ini, testpaths: lib
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, Faker-8.4.0, cov-2.12.1, pyfakefs-4.5.0, hypothesis-6.13.14, cases-3.6.1
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:975: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:671: in _load_unlocked
    ???
&lt;frozen importlib._bootstrap_external&gt;:783: in exec_module
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
lib/matplotlib/__init__.py:107: in &lt;module&gt;
    from . import _api, cbook, docstring, rcsetup
lib/matplotlib/cbook/__init__.py:31: in &lt;module&gt;
    from matplotlib import _api, _c_internal_utils
E   ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2/lib/matplotlib/__init__.py)
========================================================================= short test summary info ==========================================================================
ERROR  - ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbui...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.49s ============================================================================="><pre class="notranslate"><span class="pl-c1">+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages</span>
<span class="pl-c1">+ PYTHONDONTWRITEBYTECODE=1</span>
<span class="pl-c1">+ xvfb-run -a -s '-screen 0 640x480x24' /usr/bin/pytest -ra</span>
<span class="pl-c1">=========================================================================== test session starts ============================================================================</span>
<span class="pl-c1">platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1</span>
<span class="pl-c1">rootdir: /home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2, configfile: pytest.ini, testpaths: lib</span>
<span class="pl-c1">plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, Faker-8.4.0, cov-2.12.1, pyfakefs-4.5.0, hypothesis-6.13.14, cases-3.6.1</span>
<span class="pl-c1">collected 0 items / 1 error</span>

<span class="pl-c1">================================================================================== ERRORS ==================================================================================</span>
<span class="pl-c1">______________________________________________________________________ ERROR collecting test session _______________________________________________________________________</span>
<span class="pl-c1">/usr/lib64/python3.8/importlib/__init__.py:127: in import_module</span>
<span class="pl-c1">    return _bootstrap._gcd_import(name[level:], package, level)</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:975: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:671: in _load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap_external&gt;:783: in exec_module</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">lib/matplotlib/__init__.py:107: in &lt;module&gt;</span>
<span class="pl-c1">    from . import _api, cbook, docstring, rcsetup</span>
<span class="pl-c1">lib/matplotlib/cbook/__init__.py:31: in &lt;module&gt;</span>
<span class="pl-c1">    from matplotlib import _api, _c_internal_utils</span>
<span class="pl-c1">E   ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2/lib/matplotlib/__init__.py)</span>
<span class="pl-c1">========================================================================= short test summary info ==========================================================================</span>
<span class="pl-c1">ERROR  - ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbui...</span>
<span class="pl-c1">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span>
<span class="pl-c1">============================================================================= 1 error in 0.49s =============================================================================</span></pre></div>
<p dir="auto">I'm trying to build rpm package with matplotlib module.<br>
setuptools build and install are ok but pytest is failing for me.<br>
May I ask for poin on what I'm doing wrong?</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="+ PATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/bin:/usr/bin:/usr/sbin:/usr/local/sbin
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2, configfile: pytest.ini, testpaths: lib
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, cov-2.11.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, flaky-3.7.0, requests-mock-1.9.2, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, hypothesis-6.13.5, rerunfailures-9.1.1
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:975: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:671: in _load_unlocked
    ???
&lt;frozen importlib._bootstrap_external&gt;:783: in exec_module
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
lib/matplotlib/__init__.py:107: in &lt;module&gt;
    from . import _api, cbook, docstring, rcsetup
lib/matplotlib/cbook/__init__.py:31: in &lt;module&gt;
    from matplotlib import _api, _c_internal_utils
E   ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2/lib/matplotlib/__init__.py)
========================================================================= short test summary info ==========================================================================
ERROR  - ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbui...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.41s ============================================================================="><pre class="notranslate"><span class="pl-c1">+ PATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/bin:/usr/bin:/usr/sbin:/usr/local/sbin</span>
<span class="pl-c1">+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib/python3.8/site-packages</span>
<span class="pl-c1">+ /usr/bin/python3 -Bm pytest -ra</span>
<span class="pl-c1">=========================================================================== test session starts ============================================================================</span>
<span class="pl-c1">platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1</span>
<span class="pl-c1">rootdir: /home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2, configfile: pytest.ini, testpaths: lib</span>
<span class="pl-c1">plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, cov-2.11.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, flaky-3.7.0, requests-mock-1.9.2, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, hypothesis-6.13.5, rerunfailures-9.1.1</span>
<span class="pl-c1">collected 0 items / 1 error</span>

<span class="pl-c1">================================================================================== ERRORS ==================================================================================</span>
<span class="pl-c1">______________________________________________________________________ ERROR collecting test session _______________________________________________________________________</span>
<span class="pl-c1">/usr/lib64/python3.8/importlib/__init__.py:127: in import_module</span>
<span class="pl-c1">    return _bootstrap._gcd_import(name[level:], package, level)</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:975: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:671: in _load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap_external&gt;:783: in exec_module</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">lib/matplotlib/__init__.py:107: in &lt;module&gt;</span>
<span class="pl-c1">    from . import _api, cbook, docstring, rcsetup</span>
<span class="pl-c1">lib/matplotlib/cbook/__init__.py:31: in &lt;module&gt;</span>
<span class="pl-c1">    from matplotlib import _api, _c_internal_utils</span>
<span class="pl-c1">E   ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2/lib/matplotlib/__init__.py)</span>
<span class="pl-c1">========================================================================= short test summary info ==========================================================================</span>
<span class="pl-c1">ERROR  - ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbui...</span>
<span class="pl-c1">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span>
<span class="pl-c1">============================================================================= 1 error in 0.41s =============================================================================</span></pre></div>