【问题标题】:WindowsError: [Error 5] Access is denied while installing statsmodels using CanopyWindowsError:[错误 5] 使用 Canopy 安装 statsmodels 时访问被拒绝
【发布时间】:2017-05-02 21:25:46
【问题描述】:

我是 python 的新手。我最近安装了 Canopy,然后成功安装了包 xlrd。但是,我尝试使用包管理器安装 statsmodel 和 scikit_learn。这是我尝试安装时的错误日志。

热身……

Fetching: intel_runtime-14.0.6.241-1.egg (4.63 MB)
[................................................................................]

Fetching: MKL-2017.0.1-1.egg (139.55 MB)
[................................................................................]

Fetching: numpy-1.10.4-4.egg (3.40 MB)
[................................................................................]

Fetching: scipy-0.17.1-3.egg (12.72 MB)
[................................................................................]

Fetching: setuptools-23.1.0-2.egg (681 KB)
[................................................................................]

Fetching: patsy-0.4.1-2.egg (474 KB)
[................................................................................]

Fetching: pandas-0.19.0-1.egg (9.57 MB)
[................................................................................]

Fetching: statsmodels-0.6.1-18.egg (5.98 MB)
[................................................................................]

Removing egg: pandas-0.18.0-8.egg (24.96 MB)
[................................................................................]

Removing egg: setuptools-23.1.0-1.egg (1.74 MB)
[................................................................................]

Removing egg: scipy-0.17.1-1.egg (37.65 MB)
[................................................................................]

Removing egg: numpy-1.10.4-1.egg (11.98 MB)
[................................................................................]

Removing egg: MKL-11.1.4-1.egg (230.83 MB)
[................................................................................]

Installing egg: intel_runtime-14.0.6.241-1.egg (13.36 MB)
[................................................................................]

Installing egg: MKL-2017.0.1-1.egg (389.41 MB)
[................................................................................]

Installing egg: MKL-2017.0.1-1.egg (389.41 MB)
[................................................................................]

Traceback(最近一次调用最后一次):

文件 "build\bdist.win-amd64\egg\canopy_dashboard\packman\package_action_worker.py", 第 54 行,在运行文件中 "build\bdist.win-amd64\egg\canopy_dashboard\packman\package_action.py", 第 193 行,在执行文件中 “build\bdist.win-amd64\egg\canopy_dashboard\packman\packman.py”,行 346,在文件中 “build\bdist.win-amd64\egg\canopy_dashboard\packman\packman.py”,行 893,在 _install 文件中 "build\bdist.win-amd64\egg\canopy_platform\cpython_packages_manager.py", 第 102 行,在 install_package PackageInstallationError: 安装 包 statsmodels 0.6.1-18 失败。详细信息如下:标准输出: 标准错误:异常:回溯(最近一次调用):文件 "build\bdist.win-amd64\egg\canopy_platform\assets\enpkg_slave.py", 第 358 行,在主文件中 "build\bdist.win-amd64\egg\canopy_platform\assets\enpkg_slave.py", 第 84 行,在 install_package 文件中 "build\bdist.win-amd64\egg\canopy_platform\assets\enpkg_slave.py", 第 96 行,在 install_packages 文件中 "F:\Udemy\canopy\Workspace\User\lib\site-packages\enstaller\cli\utils.py", 第 179 行,在 install_req 中 enpkg.execute(actions) 文件 "F:\Udemy\canopy\Workspace\User\lib\site-packages\enstaller\enpkg.py", 第 350 行,在执行中 action.execute() 文件 "F:\Udemy\canopy\Workspace\User\lib\site-packages\enstaller\enpkg.py", 第 149 行,在执行中 对于 self.iter_execute() 中的 current_extracted_size:文件“F:\Udemy\canopy\Workspace\User\lib\site-packages\enstaller\enpkg.py”, 第 143 行,在 iter_execute 中 对于installer.install_iterator(extra_info)中的步骤:文件“F:\Udemy\canopy\Workspace\User\lib\site-packages\egginst\main.py”, 第 461 行,在 install_iterator n = self._extract(arcname, is_custom_egg) 文件“F:\Udemy\canopy\Workspace\User\lib\site-packages\egginst\main.py”, 第 479 行,在 _extract 中 self._write_arcname(name) 文件 "F:\Udemy\canopy\Workspace\User\lib\site-packages\egginst\main.py", 第 557 行,在 _write_arcname self.z.extract_to(arcname, destination, self.prefix) 文件 "F:\Udemy\canopy\Workspace\User\lib\site-packages\egginst_zipfile.py", 第 35 行,在 extract_to 中 return self._extract_member_to(member, destination, path, pwd) 文件 "F:\Udemy\canopy\Workspace\User\lib\site-packages\egginst_zipfile.py", 第 96 行,在 _extract_member_to _unlink_if_exists(targetpath) 文件 "F:\Udemy\canopy\Workspace\User\lib\site-packages\egginst_zipfile.py", 第 113 行,在 _unlink_if_exists 中 os.unlink(p) WindowsError: [错误 5] 访问被拒绝:'F:\Udemy\canopy\Workspace\User\Scripts\mk2iomp5md.dll'

我尝试在管理员模式下运行 Canopy,还使用了命令提示符下的命令“python -m pip install statsmodels”,但这也无济于事。

有什么想法吗?

【问题讨论】:

    标签: python python-2.7 scikit-learn statsmodels canopy


    【解决方案1】:

    很抱歉给您带来麻烦。 Windows 有时会锁定库文件,从而干扰软件包安装。 Canopy 2.0(1 月)将更好地防范这种情况。同时,请重启 Windows,然后从开始菜单打开 Canopy 命令提示符(不要打开 Canopy 本身),然后键入以下命令:

    enpkg statsmodels

    【讨论】:

    • 您好乔纳森,感谢您的回复。我按照您的步骤进行操作,似乎可行。但是,我是 python 的新手,我不确定如何检查树冠是否已安装 statsmodels 和 scikit-learn?有什么命令可以让我去检查 Canopy UI 吗?
    • a) 包管理器应显示已安装的包。
    • b) 您应该能够在 Canopy GUI 的 Python 面板中导入包。 import statsmodels
    • 非常感谢乔纳森。我真的很感激!
    猜你喜欢
    • 2011-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-03
    • 2016-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多