# Cant provide proxy setting

**URL:** <https://community.pinecone.io/t/cant-provide-proxy-setting/5675>\
**Category:** Support\
**Created:** [May 22, 2024, 11:09am UTC](https://community.pinecone.io/t/cant-provide-proxy-setting/5675 "2024-05-22T11:09:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![usman.vecho](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/usman.vecho/32/2671_2.png) [@usman.vecho](https://community.pinecone.io/u/usman.vecho)\
**Post date:** [May 22, 2024, 11:09am UTC](https://community.pinecone.io/t/cant-provide-proxy-setting/5675/1 "2024-05-22T11:09:39Z")

</div>

**URLs have spaces as I am unable to post this thread with too many urls**  
Hi, I am trying to deploy small app on pythonanywhere,  
let me explain with code,

```auto
from dotenv import load_dotenv
from pinecone import Pinecone
from langchain_openai import OpenAIEmbeddings
from langchain.vectorstores import Pinecone as PineconeVectorStore
load_dotenv()

pc = Pinecone(api_key='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',proxy_url='http://proxy . server : 3128')
print(pc.list_indexes())
embeddings = OpenAIEmbeddings()

vectorstore_from_docs = PineconeVectorStore.from_existing_index(index_name="michaeles", embedding=embeddings)

```

**I need to add prxy url to pinecone, and its totally possible by giving proxy\_url to Pinecone, but when I execute `PineconeVectorStore.from_existing_index()` I get pinecone errors that are related to proxy, here are errors**:

```auto
HTTPSConnectionPool(host='api . pinecone . io', port=443): Max retries exceeded with url: /indexes (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fb9c4385870>: Failed to establish a new connection: [Errno 111] Connection refused'))

```

as I remember in previous pinecone versions, we can provide proxy in url and then we can use these functions directly from pinecone rather than with langchain.vectorstores

```auto
import Pinecone as PineconeVectorStore like below,
openapi_config = OpenApiConfiguration.get_default_copy()
openapi_config.proxy = "http:// proxy . server : 3128"

pinecone.init(
    api_key="xxxxxxxxxxxxxxxx", # find at app.pinecone.io
    environment="us-west4-gcp-free", # next to api key in console
    openapi_config=openapi_config
)
index_name = "pf1"

docsearch = Pinecone.from_texts([t.page_content for t in texts], embeddings, index_name=index_name)

```

I want to do something like this above code that worked for me in the past.  
can someone please help me with this, will downgrading pinecone will help?

---

<div class="post-metadata">

**Author:** ![patrick1](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/patrick1/32/1863_2.png) [@patrick1](https://community.pinecone.io/u/patrick1)\
**Post date:** [May 22, 2024, 2:38pm UTC](https://community.pinecone.io/t/cant-provide-proxy-setting/5675/2 "2024-05-22T14:38:03Z")

</div>

@clyde.hunter1984[post](https://community.pinecone.io/t/error-during-upsert-with-langchain/5667/3) hints how to do this.

Here is the full code.

```auto
from pinecone import Pinecone
from langchain_openai import OpenAIEmbeddings
from langchain_pinecone import PineconeVectorStore

embeddings = OpenAIEmbeddings()

pc = Pinecone(api_key='XXXXXX',
              proxy_url='http://127.0.0.1:8080',
              ssl_ca_certs='~/.mitmproxy/mitmproxy-ca.pem')

index = pc.Index('test')

vectorstore = PineconeVectorStore(index=index, embedding=embeddings)
vectorstore.add_texts(['hello pinecone index'])

```

The key point is that the `index` argument will take a Pinecone Index object and `index_name` takes a string, then connects to the Pinecone Index for you.

So, if you ever need to use an argument that is only in the Pinecone client, you can use the approach above.

Please ensure you are using the latest version of both LangChain and the pinecone-client, as the code snippet earlier had a mix of old and new function calls.
