如何使用Windows安装pyPDF2模块? [英] How do I install pyPDF2 module using windows?
问题描述
作为一个新手...我在安装pyPDF2模块时遇到了困难.我已经下载了.我在哪里以及如何安装(setup.py),以便可以在python解释器中使用模块?
As a newbie... I am having difficulties installing pyPDF2 module. I have downloaded. Where and how do I install (setup.py) so I can use module in python interpreter?
推荐答案
要在Windows下安装setup.py文件,可以使用以下命令行选择此方式:
To install setup.py files under Windows you can choose this way with the command line:
- 点击Windows键
- 输入cmd
- 执行命令行(黑色窗口)
- 键入
cd C:\Users\User\Downloads\pyPDF2
进入setup.py
所在的目录(如果我下载了该目录,则为我的目录).可以从资源管理器窗口复制路径. - 键入
dir
现在,您应该在所有内容列表中看到名称setup.py - 类型
C:\python27\python.exe setup.py install
我在这里使用Python2.7.将C:\python33\python.exe setup.py install
用于python 3.3等.如果愿意,可以立即按照以下说明进行操作: http://docs.python.org/2/install/index. html
- hit windows key
- type cmd
- excute the command line (black window)
- type
cd C:\Users\User\Downloads\pyPDF2
to go into the directory where thesetup.py
is (this is mine if I downloaded it) The path can be copied from the explorer window. - type
dir
now you should see the name setup.py in the listing of all contents - type
C:\python27\python.exe setup.py install
I use Python2.7 here. UseC:\python33\python.exe setup.py install
for python 3.3 and so on. You can follow these instructions now if you wish: http://docs.python.org/2/install/index.html
出现问题时不显示的另一种方法是:
Another way, that does not show when there are problems, is:
- 创建
setup.py
的快捷方式
- 打开快捷方式的属性.应该有这样的路径:
C:\Users\User\Downloads\pyPDF2\setup.py
(这是我的setup.py所在的位置) -
您可以通过以下方式修改该路径:
- create a shortcut to
setup.py
- open the properties of the shortcut. There should be a path like this:
C:\Users\User\Downloads\pyPDF2\setup.py
(this is where my setup.py is) you modify that path in the following way:
"C:\Users\User\Downloads\pyPDF2\setup.py" install
如果路径名中有空格,则"
很重要
The "
are important if you have white spaces in the path name
在所有情况下,您可能都需要重新启动python才能导入模块.
In all cases you may need to restart your python to be able to import the module.
执行此操作后,您还可以在解决方案中同时贴上其他寻找它的新手的图片.
When you do this feel free to post your solution also with pictures for other newbies looking for it.
这篇关于如何使用Windows安装pyPDF2模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!