Problem with a Python module

34 views
Skip to first unread message

Julian

unread,
May 11, 2026, 11:38:37 AM (2 days ago) May 11
to Machine Learning for Kids
Hey. I'm using Ml4kids in school rn and I've run into a problem with the ydf-module required to run the ml4kids code in my python code. The problem is that whatever I do, I can't download and install the module. What should I do since nothing I tried works 

Dale Lane

unread,
May 11, 2026, 11:39:38 AM (2 days ago) May 11
to Machine Learning for Kids
Can you share what operating system and what version of Python you are using, please? 

Kind regards

D

Julian Jürgens

unread,
May 12, 2026, 3:27:09 PM (yesterday) May 12
to Dale Lane, Machine Learning for Kids
Hi im using Python 3.16.4 and the os is macOS Tahoe 26.4
--
https://machinelearningforkids.co.uk
---
You received this message because you are subscribed to a topic in the Google Groups "Machine Learning for Kids" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mlforkids/ZvuxCI6BlSE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mlforkids+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/mlforkids/07fd7fae-038e-40bd-ad17-b88567f75a5cn%40googlegroups.com.

Dale Lane

unread,
May 12, 2026, 3:58:03 PM (yesterday) May 12
to Machine Learning for Kids
There are a lot of Python packages that don't yet have support for 3.16. This is not unusual, and is often the case - this is especially true for ML packages

Looking at https://pypi.org/project/ydf/0.12.0/#files there are only builds available for Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 
(assuming you have an ARM64 Mac)

(If none of those work for you, you could try a newer version of ydf - if you updated from 0.12.0 to the latest 0.16.1 there are more MacOS builds available but still only up to Python 3.13)

Personally I use homebrew to manage multiple different Python installs on my Mac, and keep 3.11 3.12 and 3.13 around as that means I'm covered for more or less anything.

Kind regards

D

Julian

unread,
May 12, 2026, 4:23:37 PM (yesterday) May 12
to Machine Learning for Kids
hi i am using python 3.16.4 and the os is macOS Tahoe 26.4 but I also ted downloading the module on python 3.9,3.10 and 3.11

Dale Lane

unread,
May 12, 2026, 4:27:09 PM (yesterday) May 12
to Machine Learning for Kids
Do you mind sharing what happens when you tried, please? 

For example, this is what happened for me:

dalelane@Dales-MacBook-Pro-2 ~ % cd /tmp
dalelane@Dales-MacBook-Pro-2 /tmp % mkdir quick-test
dalelane@Dales-MacBook-Pro-2 /tmp % cd quick-test
dalelane@Dales-MacBook-Pro-2 quick-test % python3.11 -mvenv venv
dalelane@Dales-MacBook-Pro-2 quick-test % source venv/bin/activate
(venv) dalelane@Dales-MacBook-Pro-2 quick-test % pip install ydf
Collecting ydf
  Downloading ydf-0.16.1-cp311-cp311-macosx_12_0_arm64.whl.metadata (3.8 kB)
Collecting numpy (from ydf)
  Downloading numpy-2.4.4-cp311-cp311-macosx_14_0_arm64.whl.metadata (6.6 kB)
Collecting absl_py (from ydf)
  Using cached absl_py-2.4.0-py3-none-any.whl.metadata (3.3 kB)
Collecting protobuf<8.0.0,>=6.31.1 (from ydf)
  Using cached protobuf-7.34.1-cp310-abi3-macosx_10_9_universal2.whl.metadata (595 bytes)
Downloading ydf-0.16.1-cp311-cp311-macosx_12_0_arm64.whl (8.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.2/8.2 MB 221.8 kB/s eta 0:00:00
Using cached protobuf-7.34.1-cp310-abi3-macosx_10_9_universal2.whl (429 kB)
Using cached absl_py-2.4.0-py3-none-any.whl (135 kB)
Downloading numpy-2.4.4-cp311-cp311-macosx_14_0_arm64.whl (5.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.5/5.5 MB 202.1 kB/s eta 0:00:00
Installing collected packages: protobuf, numpy, absl_py, ydf
Successfully installed absl_py-2.4.0 numpy-2.4.4 protobuf-7.34.1 ydf-0.16.1

[notice] A new release of pip is available: 25.0.1 -> 26.1.1
[notice] To update, run: pip install --upgrade pip
(venv) dalelane@Dales-MacBook-Pro-2 quick-test %

Julian

unread,
3:15 AM (14 hours ago) 3:15 AM
to Machine Learning for Kids
this is what happens when I try it:

error: externally-managed-environment


× This environment is externally managed

╰─> To install Python packages system-wide, try brew install

    xyz, where xyz is the package you are trying to

    install.

    

    If you wish to install a Python library that isn't in Homebrew,

    use a virtual environment:

    

    python3 -m venv path/to/venv

    source path/to/venv/bin/activate

    python3 -m pip install xyz

    

    If you wish to install a Python application that isn't in Homebrew,

    it may be easiest to use 'pipx install xyz', which will manage a

    virtual environment for you. You can install pipx with

    

    brew install pipx

    

    You may restore the old behavior of pip by passing

    the '--break-system-packages' flag to pip, or by adding

    'break-system-packages = true' to your pip.conf file. The latter

    will permanently disable this error.

    

    If you disable this error, we STRONGLY recommend that you additionally

    pass the '--user' flag to pip, or set 'user = true' in your pip.conf

    file. Failure to do this can result in a broken Homebrew installation.

    

    Read more about this behavior here: <https://peps.python.org/pep-0668/>


note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.

hint: See PEP 668 for the detailed specification.

 and when I try using home-brew it tells me that home-brew doesn't know the ydf package

Dale Lane

unread,
3:17 AM (14 hours ago) 3:17 AM
to Machine Learning for Kids
That error message is telling you what the issue is (that you can't install packages into the global space) and is giving you the solution: 


If you wish to install a Python library that isn't in Homebrew,

    use a virtual environment:

    

    python3 -m venv path/to/venv

    source path/to/venv/bin/activate

    python3 -m pip install xyz


replace "xyz" with ydf, and that's basically it. 

If you also look above at the commands that I showed you, you'll see that I essentially did that too.

Kind regards

D

Julian

unread,
10:53 AM (6 hours ago) 10:53 AM
to Machine Learning for Kids
hey I now tried it like you said but it still gives me error messages and tells me to upgrade pip but im already o. the latest pip version
This is what it tells me now:

ERROR: Ignored the following yanked versions: 0.0.0

ERROR: Could not find a version that satisfies the requirement ydf (from versions: none)


[notice] A new release of pip is available: 26.1 -> 26.1.1

[notice] To update, run: pip install --upgrade pip

ERROR: No matching distribution found for ydf


Dale Lane

unread,
10:53 AM (6 hours ago) 10:53 AM
to Machine Learning for Kids
Could you show me a little more context, please? It's hard to know what the problem is without seeing what command you ran first. 

Julian

unread,
12:14 PM (5 hours ago) 12:14 PM
to Machine Learning for Kids
this is everything I see in my terminal:

julian ~ % python3 -m venv path/to/venv

julian~ % source path/to/venv/bin/activate

(venv) julian ~ % python3 -m pip install ydf

WARNING: Cache entry deserialization failed, entry ignored

ERROR: Ignored the following yanked versions: 0.0.0

ERROR: Could not find a version that satisfies the requirement ydf (from versions: none)


[notice] A new release of pip is available: 26.1 -> 26.1.1

[notice] To update, run: pip install --upgrade pip

ERROR: No matching distribution found for ydf

(venv) julian ~ % 



(I just deleted the:" my name" @ MacBook......)

Dale Lane

unread,
12:26 PM (4 hours ago) 12:26 PM
to Machine Learning for Kids
As we discussed above, the key factor here is likely to be the Python version - and I can't tell what version of Python you've got "python3" aliased to. 

Can you share the output of this command, please? (after sourcing the activate script for your venv)
python --version && pip debug --verbose

Kind regards

D

PS - one small observation - while "path/to/venv" will technically work, it's unusual to do that. 
That is included in the error message as a way of describing to you that you give it the path to the venv folder, rather than being a literal location you should use.
Running it like that means you're creating a folder called "path", and inside that a subfolder called "to", and inside that, the "venv" folder
folder-screenshot.jpg
Reply all
Reply to author
Forward
0 new messages