New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing `pip2nix generate` fails on Mac OS High Sierra when installing numpy #43

Closed
betoesquivel opened this Issue Dec 14, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@betoesquivel

betoesquivel commented Dec 14, 2017

Hi, I am new to nix and am trying to run pip2nix. This is my requirements.txt:

gensim==2.1.0
matplotlib==1.5.3
nltk==3.2.1
numpy==1.12.0
pandas==0.18.1
scikit_learn==0.19.0
tensorflow==1.3.0
boto3==1.4.7
elasticsearch==6.0.0

I started a shell with nix-shell path/to/pip2nix/release.nix -A pip2nix.python36.
That works, but when running pip2nix generate -r requirements.txt I get an error "framework not found Accelerate":

    build/src.macosx-10.6-x86_64-3.5/numpy/core/include/numpy/__multiarray_api.h:1463:1: warning: unused function '_import_array' [-Wunused-function]
    _import_array(void)
    ^
    1 warning generated.
    clang-4.0: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
    clang-4.0: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
    ld: framework not found Accelerate
    clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
    ld: framework not found Accelerate
    clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)

I thought the non-python dependencies where needed after the requirements.nix was created, but apparently I need to add dependencies also to this step.

@tigrus

This comment has been minimized.

tigrus commented Dec 23, 2017

How to install external deps? Any progress on this?

In pypi2nix we can use -E flag.

@datakurre

This comment has been minimized.

Contributor

datakurre commented Dec 23, 2017

@betoesquivel AFAIK pip2nix requires all requirements to be installable with pip at first for it to be able to generate requirements.nix from requirements.txt. So, you might be able to use pip2nix for you requirements on some other system and then move the resulting requirements.nix onto your final system to be complemented with buildInput overrides.

@johbo

This comment has been minimized.

Owner

johbo commented Dec 28, 2017

pip2nix does not have any support to bring in external deps on the fly. What I do most of the time is to use a nix-shell which has all the extra dependencies available.

The generate step fails typically when a setup.py does depend on external things already in the call of egg_info. I assume that's the case for numpy.

@johbo

This comment has been minimized.

Owner

johbo commented Dec 29, 2017

Just ran into a similar issue, added some notes into the docs: https://github.com/johbo/pip2nix/blob/master/docs/tips.rst

This won't solve the issue directly, might be helpful as inspiration though. The requirements look to me as if that's something I would only do after giving myself some time to become familiar with Nix. Maybe using things like numpy out of Nixpkgs is an option as well?

@betoesquivel

This comment has been minimized.

betoesquivel commented Feb 16, 2018

Sorry for the long-time to respond. Yeah, those tips you wrote help! Thanks!
I think I am getting the whole nix-way to do things.

Thanks for your help.

@betoesquivel

This comment has been minimized.

betoesquivel commented Feb 16, 2018

Close due to solution now in docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment