[Nix-dev] buildPythonPackage: add src to PYTHONPATH before build?
Rok Garbas
rok at garbas.si
Wed Apr 22 09:44:47 CEST 2015
Quoting Jeffrey David Johnson (2015-04-22 08:36:34)
> I'm trying to package a python application (https://github.com/dagraham/etm-tk).
> I made an initial package with python2nix, but when I try to install it I get:
>
> installing ‘python2.7-etm’
> these derivations will be built:
> /nix/store/a1xn163ms6rg3w9k901lr6fga4lawqx9-python2.7-etm.drv
> building path(s) ‘/nix/store/bncc469m7v8r5i11ak9my9dxdjvm6cpg-python2.7-etm’
> unpacking sources
> unpacking source archive /nix/store/jdhl79isbzapyyz6vlh22i03m9lbc00w-etm-tk-7b6ba79
> source root is etm-tk-7b6ba79
> patching sources
> configuring
> building
> Traceback (most recent call last):
> File "setup.py", line 3, in <module>
> from etmTk.v import version
> ImportError: No module named etmTk.v
> builder for ‘/nix/store/a1xn163ms6rg3w9k901lr6fga4lawqx9-python2.7-etm.drv’ failed with exit code 1
> error: build of ‘/nix/store/a1xn163ms6rg3w9k901lr6fga4lawqx9-python2.7-etm.drv’ failed
>
> How should I handle the setup.py importing a module from inside the package?
> I imagine there's a hook somewhere where I could add it to the PYTHONPATH?
> Jeff
looks like elmTk folder is not a `python package` (does not contain
__init__.py). i would try to create __init__.py in elmTk folder in preBuild
step.
...
preBuild = ''
touch elmTk/__init__.py
'';
...
--
Rok Garbas - http://www.garbas.si
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150422/c83cfcae/attachment-0001.bin
More information about the nix-dev
mailing list