Not installing "Inference"

An error occurs when performing the installation Inference (pip install inference). What am I doing wrong?

  • Object detection
  • Windows / Google Chrome
  • Screws2 Image Dataset

1 Like

Hi Satoshi- can you try pip installing disutils into your .venv environment?

Hello Njmarraccini! I can, I just don’t know how! Can you give me any hint? I’m still a weak programmer…

You can install any package using pip install <package_name>, so pip install disutils

Hello, leo! I have already solved the installation problem. But now I have another problem. I ran the program:

from inference import get_roboflow_model
import supervision as sv
import cv2
image_file = “10.jpg”
image = cv2.imread(image_file)
model = get_roboflow_model(model_id=“screws2-wmnvv/1”)
results = model.infer(image)
detections = sv.Detections.from_roboflow(results[0].dict(by_alias=True,
if len(detections) == 10:
print(“10 screws counted. Package ready to move on.”)
print(len(detections), “screws counted. Package is not ready.”)

But now he swears that I didn’t write down the key.
Unauthorized access to roboflow API - check API key. Visit Authentication | Roboflow Docs to learn how to retrieve one.

Where should I write it?

Hey @Satoshi_Nakamoto

It looks like you didn’t include the API key necessary when initalizing a model.

You can declare your API key as an environment variable (ROBOFLOW_API_KEY) or include it within your model initialization:

model = get_roboflow_model(model_id=“screws2-wmnvv/1”, api_key="YOUR API KEY")

See more details here:

Thank you!!! It helped me!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.