Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross compiled Python 3.6 missing pip, setuptools and other core packages

I have just cross-compiled Python 3.6 from a Fedora 26 64 bit to a Raspberry Pi 3, and everything went fine until the last part where it checks for pip and setuptools:

Requirement already up-to-date: setuptools in /usr/lib/python3.6/site-packages
Requirement already up-to-date: pip in /usr/lib/python3.6/site-packages

And just before that there's a lot of gibberish that goes like:

if test "xupgrade" != "xno"  ; then \
    case upgrade in \
        upgrade) ensurepip="--altinstall --upgrade" ;; \
        install|*) ensurepip="--altinstall" ;; \
    esac; \
     _PYTHON_PROJECT_BASE=/home/ariel/Descargas/Python-3.6.3 _PYTHON_HOST_PLATFORM=linux-arm PYTHONPATH=/home/ariel/Descargas/Python-3.6.3/build/lib.linux-arm-3.6:./Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_arm-linux-gnueabihf python3.6 -m ensurepip \
        $ensurepip --root=/ ; \
fi

Apparently, it's checking for availability on my local machine, due to --root=/. If I navigate to the site-packages path under the altinstall target I only see a README.txt file. What can I do to get pip and setuptools built along Python 3.6?

Edit: This is a follow-up question for my question about how to cross-compile Python 3.6 for a Raspberry Pi 3.

like image 946
arielnmz Avatar asked Jun 30 '26 02:06

arielnmz


1 Answers

Funny that by setting the PATH of the build system to include the natively build Python required for cross-compiling will not take care of fulfilling the --with-ensurepip=install flag by checking only the host Python and not the cross-compiled one. To get pip and setuptools added to site-packages/ you need to copy the cross-compiled Python on the targeted host machine and run: ./python3 -m ensurepip --default-pip

like image 51
Cristian F. Avatar answered Jul 02 '26 17:07

Cristian F.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!