Python 如何使用 pip 安装 Openpyxl

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38364404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:41:17  来源:igfitidea点击:

How to install Openpyxl with pip

pythonpython-3.xpipopenpyxl

提问by Enigmatic Wang

I have windows 10 (64 bit). I want to utilize the Openpyxlpackage to start learning how to interact with excel and other spreadsheets.

我有 Windows 10(64 位)。我想利用该Openpyxl包开始学习如何与 excel 和其他电子表格进行交互。

I installed Python with "windowsx86-64web-basedinstaller"I have a 64 bit OS, was I mistaken when trying to install this version?

"windowsx86-64web-basedinstaller"在 64 位操作系统上安装了 Python,我在尝试安装这个版本时搞错了吗?

Python Details in Command PromptPython Installation OptionsI found some pip.exes in the script folder of python

命令提示符中的 Python 详细信息Python 安装选项I found some pip.exes in the script folder of python

回答by KoolAid

You need to ensure that C:\Python35\Sriptsis in your system path. Follow the top answer instructions hereto do that:

您需要确保它C:\Python35\Sripts在您的系统路径中。按照此处的最佳答案说明执行操作:

You run the command in windows command prompt, not in the python interpreter that you have open.

您在 Windows 命令提示符下运行该命令,而不是在您打开的 python 解释器中运行。

Press:

按:

Win+ R

Win+ R

Type CMDin the run window which has opened

键入CMD其中已开通运行窗口

Type pip install openpyxlin windows command prompt.

键入pip install openpyxlwindows 命令提示符。

回答by user7444749

I had to do: c:\Users\xxxx>c:/python27/scripts/pip install openpyxlI had to save the openpyxl files in the scripts folder.

我必须这样做:c:\Users\xxxx>c:/python27/scripts/pip install openpyxl我必须将 openpyxl 文件保存在脚本文件夹中。

回答by Haha TTpro

(optional) Install git for windows(https://git-scm.com/) to get git bash. Git bash is much more similar to Linux terminal than Windows cmd.

(可选)安装 git for windows( https://git-scm.com/) 以获取 git bash。Git bash 比 Windows cmd 更类似于 Linux 终端。

Install Anaconda 3

安装蟒蛇 3

https://www.anaconda.com/download/

It should set itself into Windows PATH. Restart your PC. Then pip should work in your cmd

它应该将自己设置为 Windows PATH。重新启动您的电脑。然后 pip 应该在你的 cmd 中工作

Then in cmd (or git bash), run command

然后在 cmd(或 git bash)中,运行命令

pip install openpyxl

回答by Don Gonzalo Cortez Mayer

  1. Go to https://pypi.org/project/openpyxl/#files
  2. Download the file and unzip in your pc in the main folder, there's a file call setup.py
  3. Install with this command: python setup.py install
  1. 转到https://pypi.org/project/openpyxl/#files
  2. 下载文件并解压到你电脑的主文件夹中,有一个名为 setup.py 的文件
  3. 使用以下命令安装:python setup.py install

回答by Kumar Jaggal

  1. https://pypi.python.org/pypi/openpyxldownload zip file and unzip it on local system.
  2. go to openpyxl folder where setup.py is present.
  3. open command prompt under the same path.
  4. Run a command: python setup.py install
  5. It will install openpyxl.
  1. https://pypi.python.org/pypi/openpyxl下载 zip 文件并在本地系统上解压。
  2. 转到存在 setup.py 的 openpyxl 文件夹。
  3. 在同一路径下打开命令提示符。
  4. 运行命令:python setup.py install
  5. 它将安装 openpyxl。