2

I have tried to install language_check library in Python 2.7 by using...

pip install language_check

and...

pip install language_check --upgrade

In both cases, I get the following error...

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

I also tried doing...

easy_install language_check

and that throws a different error...

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

How do I install language_check in this case?

Gaurav
  • 1,597
  • 2
  • 14
  • 31
  • python -m pip install language_check [stackoverflow source](http://stackoverflow.com/questions/31172719/pip-install-access-denied-on-windows) – Kruupös Aug 05 '16 at 08:37
  • 2
    The error says: `WindowsError: [Error 5] Access is denied`, so did you try running your command prompt as Administrator (root)? – Ajeet Shah Aug 05 '16 at 08:39
  • @Orions let me check that... but I was able to install other libraries using pip through the same user... If I didn't have administrator rights, I shouldn't be able to install any library right? – Gaurav Aug 05 '16 at 09:08
  • @Orions confirmed I did this as admin. – Gaurav Aug 06 '16 at 04:32
  • @MaxChrétien python -m pip install throws the same error :( – Gaurav Aug 06 '16 at 04:33

1 Answers1

2

I check the sources of the file download_lt.py (github language_check). It appears that the error occurs when you try to move the folder language_check/LanguageTool-X.Y with the command os.rename() from your TemporaryFile to your Anaconda Lib folder.

So far, @Orions is right, it is a permission problem.

Firstly, you should check your folder permission:

  • Go to your Local folder (should be C:\Users\Gaurav M\AppData\Local)
  • Right-click on Temp folder on select properties
  • Go to Security tab and Edit and Add your name if it doesn't appear under Group or user names.

Repeat the operation for your Anaconda folder. (should be C:\Users\Gaurav M\Anaconda)

Secondly, you can try:

pip install --user language_check

But the pip --user option install the package only for the 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.)

Last but not least, I presume you are using cmd or powershellas Command-line interpreter. In my opinion, using cygwin on Windows makes a lot of things easier. Although It could be painful to configure, I would recommend a pre-configure cygwin solution like Babun.

Good luck!

Kruupös
  • 5,097
  • 3
  • 27
  • 43
  • Thanks Max... I checked the Securtiy tab for both temp and anaconda... 'Gaurav' has all permissions... it still shows the same error... also I am able to install all other packages... its only language_check that's a problem... I am using cmd, but will now try to use cygwin as you recommended... lets see how it goes... – Gaurav Aug 08 '16 at 04:46