无法让pip模块在python 3.3中运行

时间:2013-03-17 03:09:44

标签: python python-3.x install pip python-module

正如我所说,我正在使用Python 3.3,我想知道是否有人可以帮助我让pip模块工作。

当我使用:help('modules')查看可用模块列表时,列表中包含“pip”。 当我然后尝试“导入pip”或“pip install'模块名称'”(显然没有引号)时,我收到错误消息。

当我输入“pip install beautifulsoup”时,我得到:

pip install beautifulsoup

SyntaxError:语法无效。

当我尝试:

“import pip”,我明白了:

追踪(最近一次呼叫最后一次):

File "<pyshell#2>", line 1, in <module>
    import pip
  File "E:\lib\site-packages\pip\__init__.py", line 9, in <module>
    from pip.log import logger
  File "E:\lib\site-packages\pip\log.py", line 7, in <module>
    from pip import backwardcompat
  File "E:\lib\site-packages\pip\backwardcompat\__init__.py", line 27, in <module>
    console_encoding = sys.__stdout__.encoding
AttributeError: 'NoneType' object has no attribute 'encoding'

如果有人可以提供帮助,我们将非常感激。祝你好运!

1 个答案:

答案 0 :(得分:0)

使用了get-pip.py,我通过Windows cmd提示符成功安装,但无法在IDLE中进行导入。这是完整的日志 - :

C:\Python33\Lib>get-pip.py install
Downloading/unpacking pip
  Downloading pip-1.3.1.tar.gz (247Kb): 247Kb downloaded
  Running setup.py egg_info for package pip

    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.txt' found under directory
 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
Installing collected packages: pip
  Found existing installation: pip 1.3.1
    Uninstalling pip:
      Successfully uninstalled pip
  Running setup.py install for pip

    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.txt' found under directory
 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
    Installing pip-3.3-script.py script to C:\Python33\Scripts
    Installing pip-3.3.exe script to C:\Python33\Scripts
    Installing pip-script.py script to C:\Python33\Scripts
    Installing pip.exe script to C:\Python33\Scripts
Successfully installed pip
Cleaning up...

C:\Python33\Lib>cd pip-1.3.1

C:\Python33\Lib\pip-1.3.1>cd pip-1.3.1

C:\Python33\Lib\pip-1.3.1\pip-1.3.1>pip install beautifulsoup4
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Python33\Lib\pip-1.3.1\pip-1.3.1>cd ..

C:\Python33\Lib\pip-1.3.1>cd..

C:\Python33\Lib>pip install beautifulsoup4
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Python33\Lib>python3-pip RPM
'python3-pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Python33\Lib>cd pip-1.3.1

C:\Python33\Lib\pip-1.3.1>cd pip-1.3.1

C:\Python33\Lib\pip-1.3.1\pip-1.3.1>get-pip.py install
Downloading/unpacking pip
  Downloading pip-1.3.1.tar.gz (247Kb): 247Kb downloaded
  Running setup.py egg_info for package pip

    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.txt' found under directory
 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
Installing collected packages: pip
  Found existing installation: pip 1.3.1
    Uninstalling pip:
      Successfully uninstalled pip
  Running setup.py install for pip

    warning: no files found matching '*.html' under directory 'docs'
    warning: no previously-included files matching '*.txt' found under directory
 'docs\_build'
    no previously-included directories found matching 'docs\_build\_sources'
    Installing pip-3.3-script.py script to C:\Python33\Scripts
    Installing pip-3.3.exe script to C:\Python33\Scripts
    Installing pip-script.py script to C:\Python33\Scripts
    Installing pip.exe script to C:\Python33\Scripts
Successfully installed pip
Cleaning up...

C:\Python33\Lib\pip-1.3.1\pip-1.3.1>sudo easy_install pandas
'sudo' is not recognized as an internal or external command,
operable program or batch file.

C:\Python33\Lib\pip-1.3.1\pip-1.3.1>setup.py install
running install
running bdist_egg
running egg_info
writing dependency_links to pip.egg-info\dependency_links.txt
writing top-level names to pip.egg-info\top_level.txt
writing pip.egg-info\PKG-INFO
writing requirements to pip.egg-info\requires.txt
writing entry points to pip.egg-info\entry_points.txt
reading manifest file 'pip.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory 'do
cs\_build'
no previously-included directories found matching 'docs\_build\_sources'
writing manifest file 'pip.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\pip
creating build\bdist.win-amd64\egg\pip\backwardcompat
copying build\lib\pip\backwardcompat\socket_create_connection.py -> build\bdist.
win-amd64\egg\pip\backwardcompat
copying build\lib\pip\backwardcompat\ssl_match_hostname.py -> build\bdist.win-am
d64\egg\pip\backwardcompat
copying build\lib\pip\backwardcompat\__init__.py -> build\bdist.win-amd64\egg\pi
p\backwardcompat
copying build\lib\pip\basecommand.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\baseparser.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\cacert.pem -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\cmdoptions.py -> build\bdist.win-amd64\egg\pip
creating build\bdist.win-amd64\egg\pip\commands
copying build\lib\pip\commands\bundle.py -> build\bdist.win-amd64\egg\pip\comman
ds
copying build\lib\pip\commands\completion.py -> build\bdist.win-amd64\egg\pip\co
mmands
copying build\lib\pip\commands\freeze.py -> build\bdist.win-amd64\egg\pip\comman
ds
copying build\lib\pip\commands\help.py -> build\bdist.win-amd64\egg\pip\commands

copying build\lib\pip\commands\install.py -> build\bdist.win-amd64\egg\pip\comma
nds
copying build\lib\pip\commands\list.py -> build\bdist.win-amd64\egg\pip\commands

copying build\lib\pip\commands\search.py -> build\bdist.win-amd64\egg\pip\comman
ds
copying build\lib\pip\commands\show.py -> build\bdist.win-amd64\egg\pip\commands

copying build\lib\pip\commands\uninstall.py -> build\bdist.win-amd64\egg\pip\com
mands
copying build\lib\pip\commands\unzip.py -> build\bdist.win-amd64\egg\pip\command
s
copying build\lib\pip\commands\zip.py -> build\bdist.win-amd64\egg\pip\commands
copying build\lib\pip\commands\__init__.py -> build\bdist.win-amd64\egg\pip\comm
ands
copying build\lib\pip\download.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\exceptions.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\index.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\locations.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\log.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\req.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\runner.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\status_codes.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\util.py -> build\bdist.win-amd64\egg\pip
creating build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\bazaar.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\git.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\mercurial.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\subversion.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\__init__.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\__init__.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\__main__.py -> build\bdist.win-amd64\egg\pip
byte-compiling build\bdist.win-amd64\egg\pip\backwardcompat\socket_create_connec
tion.py to socket_create_connection.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\backwardcompat\ssl_match_hostname.p
y to ssl_match_hostname.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\backwardcompat\__init__.py to __ini
t__.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\basecommand.py to basecommand.cpyth
on-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\baseparser.py to baseparser.cpython
-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\cmdoptions.py to cmdoptions.cpython
-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\bundle.py to bundle.cpytho
n-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\completion.py to completio
n.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\freeze.py to freeze.cpytho
n-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\help.py to help.cpython-33
.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\install.py to install.cpyt
hon-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\list.py to list.cpython-33
.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\search.py to search.cpytho
n-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\show.py to show.cpython-33
.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\uninstall.py to uninstall.
cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\unzip.py to unzip.cpython-
33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\zip.py to zip.cpython-33.p
yc
byte-compiling build\bdist.win-amd64\egg\pip\commands\__init__.py to __init__.cp
ython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\download.py to download.cpython-33.
pyc
byte-compiling build\bdist.win-amd64\egg\pip\exceptions.py to exceptions.cpython
-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\index.py to index.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\locations.py to locations.cpython-3
3.pyc
byte-compiling build\bdist.win-amd64\egg\pip\log.py to log.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\req.py to req.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\runner.py to runner.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\status_codes.py to status_codes.cpy
thon-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\util.py to util.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\bazaar.py to bazaar.cpython-33.
pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\git.py to git.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\mercurial.py to mercurial.cpyth
on-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\subversion.py to subversion.cpy
thon-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\__init__.py to __init__.cpython
-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\__init__.py to __init__.cpython-33.
pyc
byte-compiling build\bdist.win-amd64\egg\pip\__main__.py to __main__.cpython-33.
pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\entry_points.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
creating 'dist\pip-1.3.1-py3.3.egg' and adding 'build\bdist.win-amd64\egg' to it

removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing pip-1.3.1-py3.3.egg
creating c:\python33\lib\site-packages\pip-1.3.1-py3.3.egg
Extracting pip-1.3.1-py3.3.egg to c:\python33\lib\site-packages
Adding pip 1.3.1 to easy-install.pth file
Installing pip-3.3-script.py script to C:\Python33\Scripts
Installing pip-3.3.exe script to C:\Python33\Scripts
Installing pip-script.py script to C:\Python33\Scripts
Installing pip.exe script to C:\Python33\Scripts

Installed c:\python33\lib\site-packages\pip-1.3.1-py3.3.egg
Processing dependencies for pip==1.3.1
Finished processing dependencies for pip==1.3.1

在IDLE中导入pip [我在Python 3.3.0中]

  
    

&GT;

  
 import pip
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    import pip
  File "C:\Python33\lib\site-packages\pip\__init__.py", line 9, in <module>
    from pip.log import logger
  File "C:\Python33\lib\site-packages\pip\log.py", line 7, in <module>
    from pip import backwardcompat
  File "C:\Python33\lib\site-packages\pip\backwardcompat\__init__.py", line 27, in <module>
    console_encoding = sys.__stdout__.encoding
AttributeError: 'NoneType' object has no attribute 'encoding'