简体   繁体   中英

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?

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

I guess you need to provide more information about your setup, eg, 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 (eg, 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.).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM