QGIS python模块正在干扰系统级安装的另一个python模块

时间:2016-02-08 13:12:06

标签: python python-2.7 shell pip qgis

我正在Windows环境中使用QGIS Pisa。我想升级OSGeo4W中存在的Python的scipy模块。为此我从OSGeo4W windows命令shell安装了pip。我在安装后关闭了命令shell并重新打开它。 当我在OSFGeo4W windows命令shell中给出pip命令时,它指的是在系统级安装的pip模块,因此我收到错误。我不知道如何纠正这件事。这是我的错误堆栈跟踪:

    Traceback (most recent call last):
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name)
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\runpy.py", line 72, in _run_code exec code in run_globals
    File "C:\Python27_32Bit\Scripts\pip.exe\__main__.py", line 5, in <module>
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\site-packages\pip\__init__.py", line 13, in <module>
    from pip.utils import get_installed_distributions, get_prog
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\site-packages\pip\utils\__init__.py", line 26, in <module>
    from pip._vendor import pkg_resources
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 76, in <module>
    __import__('pip._vendor.packaging.specifiers')
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\site-packages\pip\_vendor\packaging\specifiers.py", line 275, in <module>
    class Specifier(_IndividualSpecifier):
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\site-packages\pip\_vendor\packaging\specifiers.py", line 374, in Specifier
    re.VERBOSE | re.IGNORECASE,
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\re.py", line 190, in compile return _compile(pattern, flags)
    File "C:\Program Files (x86)\QGIS Pisa\apps\Python27\lib\re.py", line 242, in _compile raise error, v # invalid expression
    sre_constants.error: nothing to repeat

正如您在stacktrace上看到的,从顶部开始的第3行,代码指的是安装在系统级别的python的pip模块,而不是安装在QGIS Pisa中的pip模块。我怎样才能正确地运行它?

0 个答案:

没有答案