Giter Site home page Giter Site logo

Creating venv fails about crossenv HOT 7 CLOSED

benfogle avatar benfogle commented on July 30, 2024
Creating venv fails

from crossenv.

Comments (7)

benfogle avatar benfogle commented on July 30, 2024

It looks like you're using the system version of python. First, it's important that build-python and cross-python be the exact same version, 3.6.5 in your case. Second, the version of Python that came with the system has distro-specific patches can cause incompatibilities between build-python and host-python. I highly recommend that you build Python 3.6.5 for your workstation from the same source used to build the version on the Raspberry Pi, and run crossenv using that.

from crossenv.

tgeulig avatar tgeulig commented on July 30, 2024

Meanwhile I've update host-python to 3.5.10 to be on the safe side, but that results in the same error. So I will now compile my own python 3.5.10 on host as well.

from crossenv.

tgeulig avatar tgeulig commented on July 30, 2024

Build-python and host-python are now identical. Now I get this error:

[tgeulig@sw-dev](master)> PYTHONSTARTUP= PYTHONHOME=/opt/python-3.6.10 PYTHONPATH=/opt/python-3.6.10/lib64/python3.6/lib-dynload /opt/python-3.6.10/bin/python3 -m crossenv /nentec/work/geulig/NENUX/nenux.git/user/python/build/python venv
WARNING: CC is a compound command (arm-pgc-linux-gnueabi-gcc -mlittle-endian -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/include -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/mach-bcm/include -I/nentec/work/geulig/NENUX/nenux.git/include -O1 -pipe -fno-common -fno-builtin -Wall  -Dlinux -D__linux__ -Dunix  -DEMBED -mlittle-endian -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/include -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/mach-bcm/include)
WARNING: This can cause issues for modules that don't expect it.
WARNING: Consider setting CC='arm-pgc-linux-gnueabi-gcc' and CFLAGS='-mlittle-endian -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/include -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/mach-bcm/include -I/nentec/work/geulig/NENUX/nenux.git/include -O1 -pipe -fno-common -fno-builtin -Wall -Dlinux -D__linux__ -Dunix -DEMBED -mlittle-endian -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/include -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/mach-bcm/include'
WARNING: CXX is a compound command (arm-pgc-linux-gnueabi-g++ -mlittle-endian -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/include -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/mach-bcm/include -I/nentec/work/geulig/NENUX/nenux.git/include)
WARNING: This can cause issues for modules that don't expect it.
WARNING: Consider setting CXX='arm-pgc-linux-gnueabi-g++' and CXXFLAGS='-mlittle-endian -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/include -I/nentec/work/geulig/NENUX/nenux.git/linux-4.19.x/arch/arm/mach-bcm/include -I/nentec/work/geulig/NENUX/nenux.git/include'
ERROR: Command '['/home/nentec/work/geulig/NENUX/nenux.git/user/python_modules/venv/build/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

If I run the last command directly, I get:

[tgeulig@sw-dev](master)> /home/nentec/work/geulig/NENUX/nenux.git/user/python_modules/venv/build/bin/python3 -Im ensurepip --upgrade --default-pip
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
  File "/opt/python-3.6.10/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/python-3.6.10/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/opt/python-3.6.10/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/opt/python-3.6.10/lib/python3.6/ensurepip/__init__.py", line 5, in <module>
    import tempfile
  File "/opt/python-3.6.10/lib/python3.6/tempfile.py", line 45, in <module>
    from random import Random as _Random
  File "/opt/python-3.6.10/lib/python3.6/random.py", line 42, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ModuleNotFoundError: No module named 'math'

I'm not sure how build-python is supposed to find its modules here ...
(using crossenv 0.7 now BTW)

from crossenv.

benfogle avatar benfogle commented on July 30, 2024

It sounds like lib-dynload is missing somehow. It should have been installed to /opt/python-3.6.10/lib/python3.6/lib-dynload when you ran make install. Can you verify that it's there? What arguments did you use with configure/make/make install?

from crossenv.

tgeulig avatar tgeulig commented on July 30, 2024

"/opt/python-3.6.10/lib/python3.6/lib-dynload/" isn't there, but "/opt/python-3.6.10/lib64/python3.6/lib-dynload/" is.

Complie:

./configure --prefix=/opt/python-3.6.10 --disable-shared --disable-ipv6 --enable-unicode=ucs4 --without-doc-strings
make
make install

from crossenv.

benfogle avatar benfogle commented on July 30, 2024

I'm unable to reproduce that when I build Python with those arguments in an openSUSE Leap Docker image. I get /opt/python-3.6.10/lib/python3.6/lib-dynload as expected. If I rename it to /opt/python-3.6.10/lib64/python3.6/lib-dynload, I get the same error you are seeing.

I don't know what's causing it to install incorrectly, but a quick fix:

ln -s /opt/python-3.6.10/lib64/python3.6/lib-dynload /opt/python-3.6.10/lib/python3.6/lib-dynload

from crossenv.

tgeulig avatar tgeulig commented on July 30, 2024

Thank you for your help, with this symbolic link I am finally able to compile some modules.
I don't know, why the link is necessary, but as it seems to be an issue of my environment, I am closing this issue.

from crossenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.