简体   繁体   English

如何在Ubuntu上安装当前的OpenPYXL包

[英]How to install current OpenPYXL package on Ubuntu

I have some spreadsheet reading code (using openpyxl) that works correctly on my Windows installation. 我有一些电子表格阅读代码(使用openpyxl),可以在我的Windows安装上正常工作。 On my Ubuntu Rackspace server, however, it fails with a named range error. 但是,在我的Ubuntu Rackspace服务器上,它失败并出现命名范围错误。

I notice that the openpyxl package on Ubuntu (which I installed last week using apt-get) is several years old (1.5.6). 我注意到Ubuntu上的openpyxl包(我上周使用apt-get安装)已经有好几年了(1.5.6)。 I'd like to install the newest version (1.6.2). 我想安装最新版本(1.6.2)。

What tool can I use to install the newer version, or is it something I need to do manually? 我可以使用什么工具来安装新版本,还是我需要手动完成的工具?

The Python packages available in the Ubuntu repositories generally don't get updated within an Ubuntu version, only when you upgrade to a newer Ubuntu release. Ubuntu存储库中提供的Python包通常不会在Ubuntu版本中更新,只有在升级到较新的Ubuntu版本时才会更新。

When you need newer versions of a Python package, you can use pip to get the newest version from the Python Package Index : 当您需要更新版本的Python包时,可以使用pipPython包索引中获取最新版本:

sudo pip install openpyxl

Stuck on the same problem, this is what I did to fix it. 坚持同样的问题,这是我做的修复它。

On linux machines you need to install via apt package manager: 在linux机器上,你需要通过apt包管理器安装:

sudo apt-get install python-openpyxl python3-openpyxl 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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