Impossible to import/install weaviate on macOS - python data-pipeline/populate.py won't import weaviate (How to Build a Recommendation System with AI and Semantic Search tutorial)

I have a Macbook M1

I’ve been following exactly this tutorial: https://www.youtube.com/watch?v=SF1ZlRjVsxw

All the steps (including create cluster on the website + inserting the Weaviate API key + WCS cluster URL + OpenAI API in the .env file in VS Code)

When I reach 7m12s he says:

python data-pipeline/populate.py

But it doesn’t work.

I get:

(venv) ➜  BookRecs-main git:(master) ✗ python data-pipeline/populate.py
  File "/Users/subphonica/code/BookRecs-main/data-pipeline/populate.py", line 3
    import weaviate-client
                   ^
SyntaxError: invalid syntax

Problem is it should work:

populate.py:

import os

import csv

import weaviate

I’ve done exactly as he said:

python3 -m venv venv    

source venv/bin/activate 

pip install -r requirements.txt 

Why it doesn’t work? Can someone debug me step by step pls.

I have Python 3.12

Then I tried with the latest Python Weaviate Client 4 Python | Weaviate - Vector Database but still no luck, so I went back to Weaviate Client 3.23.2 from the tutorial with pip install -r requirements.txt

Still not working - the syntax issue which doesn’t make sense, since I’m using the YouTube tutorial exactly as he said, step by step, why doesn’t it work?

Ok my bad. I quite VS Code, proceeded to pip install -r requirements.txt again, and then python data-pipeline/populate.py worked this time!

Super weird.

I think I had turned off auto-save or some sh*t.

All good cheers.

1 Like

hi @spnc !!

Welcome to our community :hugs:

Glad you figured it out!

If you need any further assistance. We are here to help!!

Happy coding :slight_smile:

I just tried to post another couple threads, and they’ve all been marked as spam…

hi @spnc !

Sorry for that. I have found. the one marked as spam and restored it.

Thanks!

1 Like