# Pinecone.from\_texts() not working?

**URL:** <https://community.pinecone.io/t/pinecone-from-texts-not-working/4149>\
**Category:** Support\
**Tags:** vector-database\
**Created:** [January 17, 2024, 6:18pm UTC](https://community.pinecone.io/t/pinecone-from-texts-not-working/4149 "2024-01-17T18:18:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![codingshubham.in](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/codingshubham.in/32/1918_2.png) [@codingshubham.in](https://community.pinecone.io/u/codingshubham.in)\
**Post date:** [January 17, 2024, 6:18pm UTC](https://community.pinecone.io/t/pinecone-from-texts-not-working/4149/1 "2024-01-17T18:18:29Z")

</div>

![Screenshot from 2024-01-17 23-47-12](https://us1.discourse-cdn.com/flex020/uploads/pinecone/original/2X/1/17990245826f05d072a1efd08baf1d586ed2d456.png)

---

<div class="post-metadata">

**Author:** ![Cory\_Pinecone](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/cory_pinecone/32/1712_2.png) [@Cory\_Pinecone](https://community.pinecone.io/u/Cory_Pinecone)\
**Post date:** [January 17, 2024, 6:26pm UTC](https://community.pinecone.io/t/pinecone-from-texts-not-working/4149/2 "2024-01-17T18:26:14Z")

</div>

Hi @codingshubham.in. As the error says, there’s no `from_texts()` method for the Python client. You might be confusing this with the Langchain `from_texts` function, but that’s not part of the Pinecone Python SDK itself. It would only be used if you’re using Langchain to work with your index.

To query your index you would use `index.query()` and supply the vector you’re querying with. There’s [an example in the Python client](https://github.com/pinecone-io/pinecone-python-client/blob/main/README.md#query-an-index) repo:

```auto
import os
from pinecone import Pinecone

pc = Pinecone(api_key='<<PINECONE_API_KEY>>')

# Find your index host by calling describe_index
# through the Pinecone web console
index = pc.Index(host=os.environ.get('INDEX_HOST'))

query_response = index.query(
    namespace="example-namespace",
    vector=[0.1, 0.2, 0.3, 0.4],
    top_k=10,
    include_values=True,
    include_metadata=True,
    filter={
        "genre": {"$in": ["comedy", "documentary", "drama"]}
    }
)

```

---

<div class="post-metadata">

**Author:** ![codingshubham.in](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/codingshubham.in/32/1918_2.png) [@codingshubham.in](https://community.pinecone.io/u/codingshubham.in)\
**Post date:** [January 17, 2024, 6:43pm UTC](https://community.pinecone.io/t/pinecone-from-texts-not-working/4149/3 "2024-01-17T18:43:57Z")

</div>

Thanks for Responding but i want to create vector embeddings for each text chunks of my related documents and store those vector embeddings of each chunk in Pinecone.

 ![Screenshot from 2024-01-18 00-08-59](https://us1.discourse-cdn.com/flex020/uploads/pinecone/original/2X/5/5cd2aecba585767999b2d06831c05a93f9fc1779.png)

---

<div class="post-metadata">

**Author:** ![yusufersayyem](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/yusufersayyem/32/1913_2.png) [@yusufersayyem](https://community.pinecone.io/u/yusufersayyem)\
**Post date:** [January 17, 2024, 6:50pm UTC](https://community.pinecone.io/t/pinecone-from-texts-not-working/4149/4 "2024-01-17T18:50:02Z")

</div>

The problem is only in the function… If it was defined, the problem would be solved… We hope for help in solving the problem of this function (from\_text)

---

<div class="post-metadata">

**Author:** ![abhijit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/abhijit/32/1933_2.png) [@abhijit](https://community.pinecone.io/u/abhijit)\
**Post date:** [January 18, 2024, 5:03am UTC](https://community.pinecone.io/t/pinecone-from-texts-not-working/4149/5 "2024-01-18T05:03:03Z")

</div>

Import pinecone from langchain

```auto
from langchain.vectorstores import Pinecone as PC

pinecone_index = PC.from_texts(docs_chunks, embeddings, index_name=index_name)

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/pinecone/original/1X/d16664eba369eeee623700cf12feab5562b37eaf.jpeg) [@system](https://community.pinecone.io/u/system)\
**Post date:** [January 19, 2024, 5:03am UTC](https://community.pinecone.io/t/pinecone-from-texts-not-working/4149/6 "2024-01-19T05:03:04Z")

</div>

Closed on January 19, 2024, 5:03am UTC

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