Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to run any python file #9

Open
sushant4452 opened this issue Aug 28, 2024 · 1 comment
Open

Not able to run any python file #9

sushant4452 opened this issue Aug 28, 2024 · 1 comment

Comments

@sushant4452
Copy link

While running my python script , I am getting below error
Please help me to fix.
Few fixes I have tried:
Disabling the ssl certificate.

PS C:\Users\320231656\OneDrive - Philips\Desktop\sushant\LangChain\langchain-crash-course> python .\1_chat_models\1_chat_model_basic.py
Traceback (most recent call last):
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpx_transports\default.py", line 69, in map_httpcore_exceptions
yield
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpx_transports\default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpcore_sync\connection_pool.py", line 216, in handle_request
raise exc from None
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpcore_sync\connection_pool.py", line 196, in handle_request
response = connection.handle_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpcore_sync\connection.py", line 99, in handle_request
raise exc
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpcore_sync\connection.py", line 76, in handle_request
stream = self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpcore_sync\connection.py", line 154, in _connect
stream = stream.start_tls(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpcore_backends\sync.py", line 152, in start_tls
with map_exceptions(exc_map):
File "C:\Users\320231656\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in exit
self.gen.throw(typ, value, traceback)
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpcore_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_base_client.py", line 973, in _request
response = self._client.send(
^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpx_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpx_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpx_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpx_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpx_transports\default.py", line 232, in handle_request
with map_httpcore_exceptions():
File "C:\Users\320231656\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in exit
self.gen.throw(typ, value, traceback)
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\httpx_transports\default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\320231656\OneDrive - Philips\Desktop\sushant\LangChain\langchain-crash-course\1_chat_models\1_chat_model_basic.py", line 17, in
result = model.invoke("What is 81 divided by 9?")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\langchain_core\language_models\chat_models.py", line 276, in invoke
self.generate_prompt(
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\langchain_core\language_models\chat_models.py", line 776, in generate_prompt
return self.generate(prompt_messages, stop=stop, callbacks=callbacks, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\langchain_core\language_models\chat_models.py", line 633, in generate
raise e
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\langchain_core\language_models\chat_models.py", line 623, in generate
self._generate_with_cache(
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\langchain_core\language_models\chat_models.py", line 845, in _generate_with_cache
result = self._generate(
^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\langchain_openai\chat_models\base.py", line 635, in _generate
response = self.client.create(**payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_utils_utils.py", line 274, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai\resources\chat\completions.py", line 668, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_base_client.py", line 1260, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_base_client.py", line 937, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_base_client.py", line 997, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_base_client.py", line 1075, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_base_client.py", line 997, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_base_client.py", line 1075, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\320231656\AppData\Local\pypoetry\Cache\virtualenvs\langchain-crash-course-nSxz39cM-py3.11\Lib\site-packages\openai_base_client.py", line 1007, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.

@sushant4452
Copy link
Author

@sammykumar108
file is not opening.
Dangerous File Blocked
The file you attempted to download was determined to be dangerous. For your protection, MediaFire does not enable distribution of dangerous files.

what is it that you shared ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@sushant4452 and others