how do I install the linear_algebra library?

See original GitHub issue

I’ve got your book. I’m working/skimming through it. I’ve hit a brick wall.

in your Readme.md you have the following snippet

from linear_algebra import distance, vector_mean
v = [1, 2, 3]
w = [4, 5, 6]
print distance(v, w)
print vector_mean([v, w])

This throws the following error:

ImportError: No module named linear_algebra

Where is the linear_algebra library from? I’ve got a feeling it should have something to do with numpy

For info I’m running python 2.7 using the anaconda stack

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
joelgruscommented, Apr 29, 2015

So the short answer is that it’s not really set up as a library that’s “installed”, it’s just a bunch of files that you can import, but you have to already be in their directory:

  1. Download the files somewhere on your computer, then either 2a. start IPython from the “code” directory, or 2b. start IPython and cd to the “code” directory

i.e. if you download the whole repo to c:\data-science-from-scratch, then in IPython you’d do

In [1]: cd c:/data-science-from-scratch/code

In [2]: from linear_algebra import vector_add

Let me know if you still can’t get it to work.

1reaction
joelgruscommented, Sep 28, 2019

you need the file linear_algebra.py containing the code from the “Linear Algebra” chapter.

if you download the code from this repo you’ll have it (and all the similar files)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation - OptimLib documentation - Read the Docs
OptimLib requires either the Armadillo or Eigen(3) C++ linear algebra libraries. (Note that Eigen version 3.4.0 requires a C++14-compatible compiler.).
Read more >
LAPACK — Linear Algebra PACKage - The Netlib
LAPACK is written in Fortran 90 and provides routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of ...
Read more >
LinearAlgebra - PyPI
1. pip install LinearAlgebra. Copy PIP instructions. Latest version. Released: Aug 6, 2015.
Read more >
linear-algebra - npm
Efficient, high-performance linear algebra library. ... Start using linear-algebra in your project by running `npm i linear-algebra`.
Read more >
Linear Algebra library by Winsoft - Blogs Embarcadero
Linear Algebra library supports Windows 32 and Windows 64. ... Package) libraries. Installation instructions can be seen in the video below.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found