Python 3.4-Win 7-尝试通过pip安装模块时出现问题 [英] Python 3.4 - Win 7 - Problems when trying to install modules via pip

查看:201
本文介绍了Python 3.4-Win 7-尝试通过pip安装模块时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在点子时遇到了一些麻烦.每当我尝试安装某些软件包时,都会出现一个奇怪的模块对象不可调用"的情况.我知道我已经安装了pip,因为我可以在C:\ Python34 \ Scripts下找到它.我已经在我的环境变量中添加了python文件夹,的确,无论我在哪里打开CMD,我都能够运行"py setup.py install"之类的东西.所以我想也许我有一个过时的点子.我在CMD尝试了"pip --version",然后我们又走了,出现了同样的错误.这是错误:

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

现在,据我了解,似乎有一些涉及Beautiful Soup模块的内容(实际上,第三行指出文件"c:\ python34 \ lib \ site-packages \ beautifulsoup4-4.4.1-py3.4 .egg \ pip__init_ _.py,主要是行177),但是....我不明白.这是什么问题?我知道我可以使用提供的setup.py安装一些软件包,但pip看起来不错,并且很简单,所以我不使用它是一个耻辱.非常感谢您的答复!

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!

推荐答案

尝试使用

python -m pip --version

python 3.4默认情况下是pip附带的,并且应该可以作为python模块(-m)调用

python 3.4 comes with pip by default, and should be invokable as a python module (-m)

这篇关于Python 3.4-Win 7-尝试通过pip安装模块时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆