简体   繁体   中英

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. 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. So I thought that maybe I've an outdated version of pip. I tried "pip --version" at CMD and there we go, the same error. 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. 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. 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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