Sandy
Sandy

Reputation: 359

How to upgrade Python Pandas version?

I am using Python in Jupyter Notebook. My Pandas version is

pandas: 0.23.4 

in which I cannot use Explode or other advanced functions. I am trying to upgrade it using the codes like:

!pip install -- upgrade pandas

But keep receiving error messages like:

Could not fetch URL https://pypi.org/simple/ipython/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/ipython/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)'))) - skipping

Does anyone know how to rewrite the codes?

Upvotes: 1

Views: 2110

Answers (2)

ugurtosun
ugurtosun

Reputation: 327

It might provide a temporary solution. I think there is a proxy or firewall rule restricting connection to pypi.org;

pip config set global.trusted-host "pypi.org files.pythonhosted.org pypi.python.org" --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org

Upvotes: 1

Yury
Yury

Reputation: 20936

I guess you need to provide more information about your setup, e.g., what operating system do you use. The call !pip install --upgrade pandas executes shell command. If, for instance, you use Ubuntu, then this command will try to install the pandas package using system package manager, and it will fail because you need sudo privileges.

It seems that you try to execute locally the code developed for the cloud collaborative platforms (e.g., Google Colab). Unfortunately, you need to do this carefully.

I would recommend to you to create a separate virtual environment for your project and install dependencies there. For instance, I use poetry to manage the dependencies in my projects but you can also use others (virtualenv, anaconda, pipenv, etc.).

Upvotes: 0

Related Questions