2016-08-04 143 views
2

我试图用在Python 2.7安装language_check库...安装错误2.7

pip install language_check 

和...

pip install language_check --upgrade 

在这两种情况下,我得到的以下错误......

Collecting language-check 
Using cached language-check-0.8.tar.gz 
Installing collected packages: language-check 
    Running setup.py install for language-check 
    Complete output from command "C:\Users\Gaurav M\Anaconda\python.exe" -c "import setuptools, tokenize;__file__='c:\\users\\gaurav~1\\appdata\\local\\temp\\pip-build-ew9qcy\\language-check\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\gaurav~1\appdata\local\temp\pip-b0zy9n-record\install-record.txt --single-version-externally-managed --compile: 
    Downloading 'LanguageTool-3.2.zip' (87.3 MiB)... 
    100% 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 597, in <module> 
     sys.exit(main()) 
     File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 592, in main 
     run_setup_hooks(config) 
     File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 561, in run_setup_hooks 
     language_tool_hook(config) 
     File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 586, in language_tool_hook 
     download_lt() 
     File "download_lt.py", line 158, in download_lt 
     os.path.join(PACKAGE_PATH, dirname)) 
    WindowsError: [Error 5] Access is denied 

    ---------------------------------------- 
Command ""C:\Users\Gaurav M\Anaconda\python.exe" -c "import setuptools, tokenize;__file__='c:\\users\\gaurav~1\\appdata\\local\\temp\\pip-build-ew9qcy\\language-check\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\gaurav~1\appdata\local\temp\pip-b0zy9n-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check 

我也想这样做...

easy_install language_check 

,并抛出一个不同的错误...

Downloading https://pypi.python.org/packages/05/2e/471a9104b0fe7bb404de6d79e2fdd0c41ad08b87a16cbb4c8c5c9300a608/language-check-0.8.tar.gz#md5=8b4e3aa5e77bff1e33d3312a6dae870b 
Processing language-check-0.8.tar.gz 
Writing c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\setup.cfg 
Running language-check-0.8\setup.py -q bdist_egg --dist-dir c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\egg-dist-tmp-py6mda 
Downloading 'LanguageTool-3.2.zip' (87.3 MiB)... 
100% 
error: [Error 145] The directory is not empty <built-in function rmdir> c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\language_check\LanguageTool-3.2\org\languagetool\rules\uk 

如何在这种情况下安装language_check?

+0

蟒-m PIP安装language_check [计算器源(http://stackoverflow.com/questions/31172719/pip-install-access-denied-on-windows) –

+2

错误表示:'WindowsError:错误5]访问被拒绝,你是否以管理员(root)身份运行命令提示符? –

+0

@Orions让我检查一下......但我可以通过同一个用户使用pip安装其他库......如果我没有管理员权限,我不应该能够安装任何库吗? – Gaurav

回答

2

我检查文件的来源download_lt.pygithub language_check)。 当您尝试将命令os.rename()TemporaryFile移动到Anaconda Lib文件夹时,似乎发生错误。

到目前为止,@Orions是正确的,这是一个权限问题。

首先,你应该检查你的文件夹权限:

  • 转到本地文件夹(应该是C:\用户\拉夫中号\应用程序数据\本地)上选择Temp文件夹
  • 右击properties
  • 转到Security选项卡和EditAdd如果您的姓名未出现在Group or user names下,则表示您的姓名。

重复您的Anaconda文件夹的操作。 (应该是C:\用户\拉夫中号\ Anaconda)的

其次,你可以尝试:

pip install --user language_check 

但是PIP --user选项安装包仅适用于用户。

Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%Python on Windows. (See the Python documentation for site.USER_BASE for full details.)

最后但并非最不重要的, 我相信你正在使用cmdpowershell作为命令行解释器。 在我看来,在Windows上使用cygwin可以使许多事情变得简单。尽管配置可能很痛苦,但我会推荐一个预配置cygwin解决方案,如Babun

祝你好运!

+0

谢谢Max ...我检查了Temp和anaconda的Securtiy标签...'Gaurav'拥有所有权限......它仍然显示相同的错误.. 。我也能够安装所有其他软件包...它唯一的language_check,这是一个问题...我使用cmd,但现在尝试使用cygwin,因为你建议...让我们看看它是怎么回事... ... – Gaurav