TensorFlow on Nixos 4.4.14 with Python 2.7

July 27, 2016 at 12:31 pm Leave a comment

was discussing this in #nixos yesterday and while the general consensus was it could be done no one knew exactly how so figured it out.

Basically the script from the nix os dev environments for python with virtual env is all you need:

 

with import <nixpkgs> {};
with pkgs.python27Packages;

buildPythonPackage {
name = “impurePythonEnv”;
buildInputs = [
git
swig
libxml2
libxslt
libzip
python27Full
python27Packages.virtualenv
stdenv
zlib ];
LD_LIBRARY_PATH = “${stdenv.cc.cc}/lib”;
src = null;
# When used as `nix-shell –pure`
shellHook = ”
unset http_proxy
export GIT_SSL_CAINFO=/etc/ssl/certs/ca-bundle.crt
”;
# used when building environments
extraCmds = ”
unset http_proxy # otherwise downloads will fail (“nodtd.invalid”)
export GIT_SSL_CAINFO=/etc/ssl/certs/ca-bundle.crt
”;
}

the only minor additions are swig you also might need to add numpy and pip if you want to. I installed pip from nix-env -i

the only minor modification is this:

LD_LIBRARY_PATH = “${stdenv.cc.cc}/lib”;

it sets the lib path so when tensorflow needs a gcc lib it can get to it.

and that is my default.nix

nix-shell in the dir with that then do a normal virtualenv install of tensorflow for python 2.7 I did it CPU only.

I am working on modifying this script so it can work with tensorflow 3.5 and possibly with open cuda, but I did this to do basic tensorflow examples at a Hack Night so might be working in something else next.

 

 

Entry filed under: media, my life through software. Tags: , , .

Some quick points on Angular vs React ABZÛ

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

July 2016
M T W T F S S
« Jan   Aug »
 123
45678910
11121314151617
18192021222324
25262728293031

Most Recent Posts


%d bloggers like this: