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

1 974 3

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.

Where Next?

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...
14 2929 7
New
telemachus
Python Testing With Pytest - Chapter 2, warnings for “unregistered custom marks” While running the smoke tests in Chapter 2, I get these...
5 2075 1
New
brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
2 1374 2
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
1 1179 3
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...
9 2047 12
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
0 1105 1
New
akraut
The markup used to display the uploaded image results in a Phoenix.LiveView.HTMLTokenizer.ParseError error. lib/pento_web/live/product_l...
2 2083 9
New
jonmac
The allprojects block listed on page 245 produces the following error when syncing gradle: “org.gradle.api.GradleScriptException: A prob...
1 2278 1
New
mcpierce
@mfazio23 I’ve applied the changes from Chapter 5 of the book and everything builds correctly and runs. But, when I try to start a game,...
0 1160 10
New
davetron5000
Hello faithful readers! If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
3 1150 19
New

Other popular topics Top

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...
36 5432 10
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
51 4319 20
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
118 4871 60
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
116 8174 31
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
82 6920 31
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
78 4119 24
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
32 3916 9
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
43 3103 21
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
106 10605 28
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
54 4591 23
New

Sub Categories: