roadbike

roadbike

Programming Machine Learning: Setting up your system (p 13)

From page 13:
On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio Code

pip3 install numpy==1.19.5
pip3 install matplotlib==3.2.2
pip3 install seaborn==0.11.1

With Windows 11 I faced these errors when trying to install Numpy 1.19.5.

  1. Microsoft Visual C++ 14.0 was required. After installing C++ I retried installing numpy to run into…
  2. “TypeError: CCompiler_spawn() got an unexpected keyword argument ‘env’”. I updated the setuptools but that did not help because I got the same error. So I tried Numpy using pip install numpy==1.19.5 --no-binary=:all: --no-build but I got
  3. the error Running cythonize failed so I installed Cython but that did not help because I got the same error after retrying to install numpy

I gave up troubleshooting and decided to install the latest versions of the packages and see what happens when I try to run the code in the book.

Should I try another route? Any suggestions for installing the packages in a Windows 11 environment? Should I expect to run into any issues later in the book because I don’t have the specific version for the packages?

Regards,
roadbike

Marked As Solved

nusco

nusco

Author of Metaprogramming Ruby & Programming Machine Learning

Hello there! I’m sorry that it’s so hard to set up a reproducible Python ML system on Windows (or anywhere else for that matter). I can only tell you that I did my darnedest to provide repeatable instructions, but anything that I wrote tended to become obsolete, and often broken, within a couple of weeks. Now that the book is a few years old, all bets are off.

First of all, did you check the Setup page on the book’s site? The instructions there aren’t guaranteed to work anymore either, but at least I could keep it updated for as long as I managed. Recently, the distance between the versions of the libraries that I used in the books and the versions that you can install on all platforms got wider. I realized that I should just come up with an updated version of the book, with updated code for all examples.

Even if the instructions on the Setup page fail for you, however, you can still install the latest libraries and read the book. To answer your question:

Should I expect to run into any issues later in the book because
I don’t have the specific version for the packages?

Yes, but probably not major ones. Usually, if you install the latest packages, you only need a few tweaks to the code to make it run fine. Most of the issues can be fixed by looking at the “Troubleshooting” section of the setup page. If you find other errors that are not listed there, I’d appreciate it if you let me know.

Popular Pragmatic Bookshelf topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
New
conradwt
First, the code resources: Page 237: rumbl_umbrella/apps/rumbl/mix.exs Note: That this file is missing. Page 238: rumbl_umbrella/app...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
Charles
In general, the book isn’t yet updated for Phoenix version 1.6. On page 18 of the book, the authors indicate that an auto generated of ro...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
New
dachristenson
I’ve got to the end of Ch. 11, and the app runs, with all tabs displaying what they should – at first. After switching around between St...
New

Other popular topics Top

PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New