导入Tensorflow时权限被拒绝

时间:2018-07-23 05:53:53

标签: python tensorflow certifi

在Windows Server 2016上,conda update之后,我无法再在Python中导入Tensorflow。我尝试重新安装并将其升级到最新版本,但是仍然出现Permission Denied错误。我该如何解决这个问题?

Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 22, in <module>
        from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
      File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 52, in <module>
        from tensorflow.core.framework.graph_pb2 import *
      File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
        from google.protobuf import descriptor as _descriptor
      File "C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\__init__.py", line 37, in <module>
        __import__('pkg_resources').declare_namespace(__name__)
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 3086, in <module>
        @_call_aside
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 3070, in _call_aside
        f(*args, **kwargs)
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 3099, in _initialize_master_working_set
        working_set = WorkingSet._build_master()
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 565, in _build_master
        ws = cls()
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 558, in __init__
        self.add_entry(entry)
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 614, in add_entry
        for dist in find_distributions(entry, True):
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 1962, in find_on_path
        for dist in factory(fullpath):
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2032, in distributions_from_metadata
        root, entry, metadata, precedence=DEVELOP_DIST,
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2471, in from_location
        py_version=py_version, platform=platform, **kw
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2833, in _reload_version
        md_version = _version_from_file(self._get_metadata(self.PKG_INFO))
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2435, in _version_from_file
        line = next(iter(version_lines), '')
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2625, in _get_metadata
        for line in self.get_metadata_lines(name):
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 1808, in get_metadata_lines
        return yield_lines(self.get_metadata(name))
      File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 1794, in get_metadata
        with io.open(self.path, encoding='utf-8', errors="replace") as f:
    PermissionError: [Errno 13] Permission denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\certifi-2018.04.16-py3.6.egg-info'

0 个答案:

没有答案