简体   繁体   English

Python 3.4-Win 7-尝试通过pip安装模块时出现问题

[英]Python 3.4 - Win 7 - Problems when trying to install modules via pip

I'm having some troubles with pip. 我在点子时遇到了麻烦。 Whenever I try to install some packages, I get a strange "module object is not callable". 每当我尝试安装某些软件包时,都会出现一个奇怪的“模块对象不可调用”的情况。 I know that I have pip installed, because I can locate it under C:\\Python34\\Scripts. 我知道我已经安装了pip,因为我可以在C:\\ Python34 \\ Scripts下找到它。 I already added the python folder to my enviromental variables, indeed i'm able to run "py setup.py install" and stuff like that wherever I open a CMD. 我已经在我的环境变量中添加了python文件夹,的确,无论我在哪里打开CMD,我都可以运行“ py setup.py install”之类的东西。 So I thought that maybe I've an outdated version of pip. 所以我认为也许我的pip版本过时了。 I tried "pip --version" at CMD and there we go, the same error. 我在CMD尝试了“ pip --version”,然后我们又走了,出现了同样的错误。 This is the error: 这是错误:

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

Now, from what I understand, it seems that there is something involving the Beautiful Soup module (indeed, the 3rd line states File "c:\\python34\\lib\\site-packages\\beautifulsoup4-4.4.1-py3.4.egg\\pip__init_ _.py", line 177, in main) but....I don't get it. 现在,据我了解,似乎有一些涉及Beautiful Soup模块的内容(实际上,第三行指出文件“ c:\\ python34 \\ lib \\ site-packages \\ beautifulsoup4-4.4.1-py3.4.egg \\ pip__init_ _.py“,主要是行177),但...我不明白。 What's the problem? 有什么问题? I'm aware that I can install some packages by using the setup.py provided, but pip seems nice and easy, so it's a shame not to use it,I guess. 我知道我可以使用提供的setup.py来安装一些软件包,但是pip看起来很不错而且很容易,所以我不使用它真是可惜。 Thanks a lot for replies! 非常感谢您的答复!

Try using 尝试使用

python -m pip --version

python 3.4 comes with pip by default, and should be invokable as a python module (-m) python 3.4默认附带pip,并且应作为python模块(-m)调用

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

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