如何升级Python Pandas版本?

发布于 2025-02-11 07:11:51 字数 602 浏览 1 评论 0原文

我在Jupyter笔记本中使用Python。我的熊猫版本

pandas: 0.23.4 

无法使用爆炸或其他高级功能。我正在尝试使用类似的代码来升级它:

!pip install -- upgrade pandas

但是继续接收错误消息,例如:

无法获取url https://pypi.org/simple/simple/ipytle/ipython/ 那里:是一个 确认SSL证书的问题: httpsconnectionpool(host ='pypi.org',端口= 443):最大检索超过 使用url:/simple/ipython/(由 sslerror(sslcertverificationerror(1,'[ssl:centerrify_failed] 证书验证失败:无法获得本地发行人证书 (_SSL.C:1045)'))) - 跳过

有人知道如何重写代码吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏九 2025-02-18 07:11:51

它可能提供临时解决方案。我认为有一个限制与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

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
以可爱出名 2025-02-18 07:11:51

我想您需要提供有关设置的更多信息,例如您使用什么操作系统。呼叫!PIP安装 - 升级pandas执行shell命令。例如,如果您使用Ubuntu,则此命令将尝试使用System Package Manager安装PANDAS包,并且由于您需要Sudo特权而失败。

似乎您尝试在本地执行为云协作平台开发的代码(例如Google COLAB)。不幸的是,您需要仔细这样做。

我建议您为您的项目创建一个单独的虚拟环境,并在此处安装依赖项。例如,我使用诗歌来管理项目中的依赖项,但您也可以使用其他诗歌(Virtualenv,Anaconda,Pipenv等)。

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.).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文