MaxRetryError when creating vectors

MaxRetryError: HTTPSConnectionPool(host='myindex', port=443): Max retries exceeded with url: /vectors/upsert (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x0000021E34472600>: Failed to resolve 'myindex' ([Errno 11001] getaddrinfo failed)"))

Hello I’m having the following error when trying to uspsert some values

index.upsert (vectors=[
    {"id": "Dog", "values": [4.0, 0.0, 1.0]},
    {"id": "Cat", "values": [4.0, 0.0, 1.0]},
    {"id": "Chicken","values": [2.0, 2.0, 1.0]},
    {"id": "Mantis","values": [6.0, 2.0, 3.0]},
    {"id": "Elephant", "values": [4.0, 0.0, 1.0]}]
)

Hello,

Can you provide your full code for connecting to Pinecone? The error message says it’s trying connect to a host called myindex which is completely incorrect and not valid. This suggests something fundamental has gone wrong.

Here is an example of how to connect and upsert records:

from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key="YOUR_API_KEY")
index = pc.Index("myindex")

index.upsert(
  vectors=[
    {"id": "Dog", "values": [4.0, 0.0, 1.0]},
    {"id": "Cat", "values": [4.0, 0.0, 1.0]},
    {"id": "Chicken","values": [2.0, 2.0, 1.0]},
    {"id": "Mantis","values": [6.0, 2.0, 3.0]},
    {"id": "Elephant", "values": [4.0, 0.0, 1.0]}
  ],
)