Impossible to import/install weaviate on macOS - python data-pipeline/ 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:

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/

But it doesn’t work.

I get:

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

Problem is it should work:

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/ 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.


1 Like