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 Prag Prog topics Top

kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
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...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
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
jonmac
The allprojects block listed on page 245 produces the following error when syncing gradle: “org.gradle.api.GradleScriptException: A prob...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
Henrai
Hi, I’m working on the Chapter 8 of the book. After I add add the point_offset, I’m still able to see acne: In the image above, I re...
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...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1016 16828 371
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
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...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New

Latest in PragProg

View all threads ❯