parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calling python script from exported bash function, module import fai


From: Benjamin Leutner
Subject: Re: calling python script from exported bash function, module import fails
Date: Thu, 22 Dec 2016 17:28:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

It also breaks with 'setuptools' or 'boto'.

I also tried with ubuntu deb file installation (apt install python-tables) instead of pip install but that doesn't make a difference.
(forgot to mention: I'm on Ubuntu Gnome 16.10 64bit)

Some examples for modules which work fine are: 'numpy', 'sys', 'yaml'

Here's the modified example:

function FUN {
echo -e "\n----- Try number: ${1}  -----"
echo "Host: $(hostname), Level:  $SHLVL"
python -c "
import setuptools
print 'import succesful'"
}
export -f FUN

# without env
parallel 'FUN {}' ::: 1

# with env for function
parallel --env FUN 'FUN {}' ::: 2

# with env for everything
parallel --env _ 'FUN {}' ::: 3

1) is fine, 2) and 3) give me :
Traceback (most recent call last):
  File "<string>", line 2, in <module>
File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 14, in <module>
    from setuptools.extension import Extension
File "/usr/lib/python2.7/dist-packages/setuptools/extension.py", line 10, in <module>
    from .dist import _get_unpatched
File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 22, in <module>
    from setuptools import windows_support
File "/usr/lib/python2.7/dist-packages/setuptools/windows_support.py", line 11, in <module>
    @windows_only
File "/usr/lib/python2.7/dist-packages/setuptools/windows_support.py", line 6, in windows_only
    if platform.system() != 'Windows':
  File "/usr/lib/python2.7/platform.py", line 1286, in system
    return uname()[0]
  File "/usr/lib/python2.7/platform.py", line 1253, in uname
    processor = _syscmd_uname('-p','')
  File "/usr/lib/python2.7/platform.py", line 988, in _syscmd_uname
    rc = f.close()
IOError: [Errno 10] No child processes



On 12/22/2016 03:48 PM, Ole Tange wrote:
On Tue, Dec 20, 2016 at 7:16 PM, Benjamin Leutner
<benjamin.leutner@uni-wuerzburg.de> wrote:

Here is a small example how exporting --env breaks it on the local machine
(running on python 2.7):

pip2 install tables
This breaks on my system. Can you find an example that does not have
so many (sub-)dependencies as 'tables'?


/Ole


--
Benjamin Leutner M.Sc.
PhD candidate

Department of Remote Sensing
University of Wuerzburg
Campus Hubland Nord 86
97074 Wuerzburg, Germany

Tel: +49-(0)931-31 89594
Fax: +49-(0)931-31 89594-0
Email: benjamin.leutner@uni-wuerzburg.de
Web: http://www.fernerkundung.uni-wuerzburg.de




reply via email to

[Prev in Thread] Current Thread [Next in Thread]