点破了,我没有管理员权限

时间:2018-11-08 19:18:51

标签: python python-3.x pip

我现在在这个问题上投入了大约6个小时,而且越来越近了。这是发生了什么。

我正在使用同时具有Python 2.7和Python 3.5的共享Linux计算机,但我没有管理员权限。我使用的是Python 3.5,并且想使用seaborn软件包,所以我发现想要的特定标签功能仅在较新的版本中可用。因此“ pip3 install seaborn --upgrade”没有问题。

一切都发生得如此之快,但是出了点问题,并且由于互联网的建议,我最终升级了其他一些软件包,例如matplotlib,setuptools,最后是pip本身。

这是真正出问题的地方。点子刚刚坏了。当我运行pip3 --version:

const app = () => (
  <VideoPlayerProvider>
    <App />
  </VideoPlayerProvider>
)  

调用堆栈中的第一行是“ from pip import main”,所以我尝试运行pip --version而不是pip3,现在我得到了:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in vendored
    __import__(vendored_name, globals(), locals(), level=0)
ImportError: No module named 'pip._vendor.pkg_resources'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 13, in <module>
    from pip.exceptions import InstallationError, CommandError, PipError
  File "/usr/lib/python3/dist-packages/pip/exceptions.py", line 6, in <module>
    from pip._vendor.six import iteritems
  File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 75, in <module>
    vendored("pkg_resources")
  File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
    __import__(modulename, globals(), locals(), level=0)
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2927, in <module>
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2913, in _call_aside
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 956, in subscribe
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2952, in <lambda>
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2515, in activate
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2097, in declare_namespace
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2047, in _handle_ns
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2066, in _rebuild_mod_path
AttributeError: '_NamespacePath' object has no attribute 'sort'

此错误在整个Internet上都是pip本身的错误,但是所有每种解决方案都涉及我无权执行的操作。我尝试使用“ python -m pip ...”卸载并重新安装较旧版本的pip,但这对pip3错误无济于事,后者在几行后提示了相同的错误。而且我不能将此快捷方式用于pip3(python3 -m pip ...),因为无论如何都会发生此错误。

最糟糕的是我的原始程序现在已经完全死了。我什至无法完全进口seaborn而不会崩溃。

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main

在这一点上,我认为,只要将自己的干净版本的Python下载到有特权的本地目录中,一切都会变得容易。因此,我在本地目录中下载并设置了新版本的Python 3.6。然后,我用它运行了原始程序,并被告知我没有名为“ numpy”的模块。合理。让我们尝试安装numpy。

Traceback (most recent call last):
  File "/u/hailey/.local/lib/python3.5/site-packages/matplotlib/__init__.py", line 861, in __setitem__
    cval = self.validate[key](val)
KeyError: 'axes.color_cycle'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nn.py", line 9, in <module>
    import seaborn as sns
  File "/usr/lib/python3/dist-packages/seaborn/__init__.py", line 13, in <module>
    set()
  File "/usr/lib/python3/dist-packages/seaborn/rcmod.py", line 98, in set
    set_palette(palette, color_codes=color_codes)
  File "/usr/lib/python3/dist-packages/seaborn/rcmod.py", line 491, in set_palette
    mpl.rcParams["axes.color_cycle"] = list(colors)
  File "/u/hailey/.local/lib/python3.5/site-packages/matplotlib/__init__.py", line 868, in __setitem__
    'list of valid parameters.' % (key,))
KeyError: 'axes.color_cycle is not a valid rc parameter. See rcParams.keys() for a list of valid parameters.'

现在,我进入一个页面,建议您运行“ setup.py install”,这听起来很简单。但是不。

Obtaining file:///u/hailey/python36/Python-3.6.0
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/u/hailey/python36/Python-3.6.0/setup.py", line 4, in <module>
        import sys, os, importlib.machinery, re, optparse
    ImportError: No module named machinery

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /u/hailey/python36/Python-3.6.0/

现在我要放弃,因为显然我对Python一无所知。我真的很感谢您的帮助。在这一点上,即使只是恢复昨天的状态也可以,因为我可以在没有海图的情况下继续生活。谢谢大家!

0 个答案:

没有答案