无法使用pip安装LinkChecker

2024-06-16 13:50:58 发布

您现在位置:Python中文网/ 问答频道 /正文

从altgraph.compat公司进口* ImportError:没有名为compat的模块

当我运行'sudo pip install LinkChecker'时 我安装了两个依赖项,这给我带来了一个错误。 但是我现在被困在这里了

     The directory '/Users/Ben/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/Ben/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting LinkChecker
  Downloading LinkChecker-9.3.tar.gz (719kB)
    100% |████████████████████████████████| 727kB 606kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-DKFXDg/LinkChecker/setup.py", line 976, in <module>
        setup(**args)
      File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/tmp/pip-build-DKFXDg/LinkChecker/setup.py", line 460, in __init__
        super(MyDistribution, self).__init__(attrs)
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 318, in __init__
        _Distribution.__init__(self, attrs)
      File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 375, in finalize_options
        ep.load()(self, ep.name, value)
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2249, in load
        return self.resolve()
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2255, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/Library/Python/2.7/site-packages/py2app/build_app.py", line 31, in <module>
        from altgraph.compat import *
    ImportError: No module named compat

我遵循本教程:

^{pr2}$

我也安装了altgraph,但仍然抛出这个错误。在


Tags: pipinpyselfinitlibusrlocal