linuxdeploy / linuxdeploy-plugin-conda

Python plugin for linuxdeploy. Sets up miniconda in an AppDir and installs user specified packages.
MIT License
29 stars 13 forks source link

Numpy not installing #39

Closed nshiell closed 3 years ago

nshiell commented 3 years ago

I'm trying to install numpy, but it's not working for me The appimage part of my creator script:

export CONDA_CHANNELS='conda-forge'
export PIP_REQUIREMENTS='numpy'

# Deploy
./linuxdeploy-x86_64.AppImage \
   --appdir AppDir \
    -i ./xxx.png \
    -d ./xxx.desktop \
    --plugin conda \
    --custom-apprun ./buildset/src/AppRun.sh \
    --output appimage`

My AppRun.sh looks like:

APPDIR=`dirname $0`
export PATH="$PATH":"${APPDIR}"/usr/bin
${APPDIR}/usr/bin/python3 ${APPDIR}/opt/xxx.py $@

And xxx.py looks like:

import numpy

When I run it I see:

  File "/tmp/.mount_Blue_LxKM3XP/usr/conda/lib/python3.8/site-packages/numpy/core/__init__.py", line 22, in <module>
    from . import multiarray
  File "/tmp/.mount_Blue_LxKM3XP/usr/conda/lib/python3.8/site-packages/numpy/core/multiarray.py", line 12, in <module>
    from . import overrides
  File "/tmp/.mount_Blue_LxKM3XP/usr/conda/lib/python3.8/site-packages/numpy/core/overrides.py", line 7, in <module>
    from numpy.core._multiarray_umath import (
ImportError: libgfortran-2e0d59d6.so.5.0.0: ELF load command address/offset not properly aligned

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/.mount_Blue_LxKM3XP/opt/xxx/xxx.py", line 5, in <module>
    import numpy
  File "/tmp/.mount_Blue_LxKM3XP/usr/conda/lib/python3.8/site-packages/numpy/__init__.py", line 145, in <module>
    from . import core
  File "/tmp/.mount_Blue_LxKM3XP/usr/conda/lib/python3.8/site-packages/numpy/core/__init__.py", line 48, in <module>
    raise ImportError(msg)
ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/tmp/.mount_Blue_LxKM3XP/usr/bin/python3"
  * The NumPy version is: "1.20.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: libgfortran-2e0d59d6.so.5.0.0: ELF load command address/offset not properly aligned

I have been able to install other pip projects, but not numpy

nshiell commented 3 years ago

Seems I was able to fix this by replaceing export PIP_REQUIREMENTS='numpy' with: export CONDA_PACKAGES='numpy'

This feels abit unpleasant to me, either I should be able to install numpy via PIP in Conda for the AppImage or I shouldn't

TheAssassin commented 3 years ago

Packages for Python that ship native code often aren't built in a way so they're relocatable. This, however, is an absolute requirement for AppImages to work properly. Using the conda package is a good solution.