Python 3.4 - Win 7 - 尝试通过pip

时间:2016-01-11 15:32:47

标签: python pip

我有一些pip的麻烦。每当我尝试安装一些软件包时,我都会遇到一个奇怪的"模块对象无法调用"。我知道我已经安装了pip,因为我可以在C:\ Python34 \ Scripts下找到它。我已经将python文件夹添加到我的环境变量中,实际上我能够运行" py setup.py install"无论我打开CMD的哪个地方都是这样的。所以我想也许我是一个过时的pip版本。我试过" pip --version"在CMD,我们去了,同样的错误。这是错误:

C:\Users\Admin\Downloads>pip --version
Traceback (most recent call last):
  File "c:\python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\pip.exe\__main__.py", line 9, in <module>
  File "c:\python34\lib\site-packages\beautifulsoup4-4.4.1-py3.4.egg\pip\__init_
_.py", line 177, in main
    cmd_name, cmd_args = parseopts(initial_args)
  File "c:\python34\lib\site-packages\beautifulsoup4-4.4.1-py3.4.egg\pip\__init_
_.py", line 129, in parseopts
    parser = create_main_parser()
  File "c:\python34\lib\site-packages\beautifulsoup4-4.4.1-py3.4.egg\pip\__init_
_.py", line 122, in create_main_parser
    description = [''] + ['%-27s %s' % (i, j) for i, j in command_summaries]
  File "c:\python34\lib\site-packages\beautifulsoup4-4.4.1-py3.4.egg\pip\__init_
_.py", line 122, in <listcomp>
    description = [''] + ['%-27s %s' % (i, j) for i, j in command_summaries]
  File "c:\python34\lib\site-packages\beautifulsoup4-4.4.1-py3.4.egg\pip\command
s\__init__.py", line 55, in get_summaries
    cmditems = _sort_commands(commands, commands_order)
  File "c:\python34\lib\site-packages\beautifulsoup4-4.4.1-py3.4.egg\pip\command
s\__init__.py", line 88, in _sort_commands
    return sorted(list(cmddict.items()), key=keyfn)
TypeError: 'module' object is not callable

现在,根据我的理解,似乎有一些涉及Beautiful Soup模块的东西(事实上,第3行陈述了File&#34; c:\ python34 \ lib \ site-packages \ beautifulsoup4-4.4.1- py3.4.egg \ pip__init_ _.py&#34;,第177行,在主要内容)但....我不明白。问题是什么?我知道我可以使用提供的setup.py来安装一些软件包,但是pip看起来很简单,所以我不想使用它是一种耻辱。非常感谢您的回复!

1 个答案:

答案 0 :(得分:0)

尝试使用

python -m pip --version

python 3.4默认带有pip,应该可以作为python模块调用(-m)