Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Unable to install allennlp via pip in Windows #1178

Closed
arjun-g opened this issue May 6, 2018 · 3 comments
Closed

Unable to install allennlp via pip in Windows #1178

arjun-g opened this issue May 6, 2018 · 3 comments

Comments

@arjun-g
Copy link

arjun-g commented May 6, 2018

When I tried installing allennlp in my machine with following configuration,

Windows 10 x64
Python 3.6.5

I am getting the following error,

Collecting allennlp
  Using cached https://files.pythonhosted.org/packages/c5/60/fa613bdea022bd6c26176f5786efcc0b5a6d8acf97131e324179a99fcbaf/allennlp-0.4.2-py3-none-any.whl
Collecting psycopg2 (from allennlp)
  Using cached https://files.pythonhosted.org/packages/00/95/4c5d19affca312e1c06d4f88241ebc564bf5269addd191ec4962f0c93553/psycopg2-2.7.4-cp36-cp36m-win32.whl
Collecting flask==0.12.1 (from allennlp)
  Using cached https://files.pythonhosted.org/packages/f4/43/fb2d5fb1d10e1d0402dd57836cf9a78b7f69c8b5f76a04b6e6113d0d7c5a/Flask-0.12.1-py2.py3-none-any.whl
Collecting scipy (from allennlp)
  Using cached https://files.pythonhosted.org/packages/30/2a/8bd20295c774e3f19b5f8b71d75ef7e802673852ca3ae2e1d231d0f1c7a2/scipy-1.1.0-cp36-none-win32.whl
Requirement already satisfied: typing in c:\users\user\appdata\local\programs\python\python36-32\lib\site-packages (from allennlp) (3.5.3.0)
Collecting pyhocon==0.3.35 (from allennlp)
  Downloading https://files.pythonhosted.org/packages/95/b9/72883593ce531e95ac8190e251ae6f5377eada69504248bf1aebfce4c5b4/pyhocon-0.3.35.tar.gz (94kB)
    100% |████████████████████████████████| 102kB 238kB/s
Requirement already satisfied: numpy in c:\users\user\appdata\local\programs\python\python36-32\lib\site-packages (from allennlp) (1.12.1)
Collecting torch==0.3.1 (from allennlp)
  Could not find a version that satisfies the requirement torch==0.3.1 (from allennlp) (from versions: 0.1.2, 0.1.2.post1)
No matching distribution found for torch==0.3.1 (from allennlp)

How can I fix this ?

@matt-gardner
Copy link
Contributor

See #612. We don't support windows, and we're a very small team that doesn't have the bandwidth to add windows support. Contributions welcome.

ozanani added a commit to ozanani/allennlp that referenced this issue Oct 25, 2018
For those who struggle trying to install it on Windows, like me :) 
(see allenai#1178)
@wangcongcong123
Copy link

Hope this detour way helps: https://github.com/wangcongcong123/AllenNLPonWins

@ankit025jain
Copy link

Hi Peeps,

I have found the solution for installing AllenNLP for windows. Please find the details of installation steps below:

Requirement:
OS – Windows 10 or higher
Python version > 3.6
Download the latest version of python or python version > 3.6. (I am using python version 3.8.8)
(Alternative method to install python versions https://realpython.com/intro-to-pyenv/ or command conda create --name project-env python=3.x)
Steps for installing allennlp package on windows machine.

  • Create virtual environment
  • Activate (base) C:>python -m venv allennlp_demo
  • (base) C:>allennlp_demo\Scripts\activate
  • Check python version.
  • (allennlp_demo) (base) C:>python -V
  • Python 3.8.8
  • Install pandas
  • (allennlp_demo) (base) C:>pip install pandas
  • Install Allennlp
  • (allennlp_demo) (base) C:>pip install allennlp==1.0.0
  • If you get an error in step 5 (ERROR: Could not find a version that satisfies the requirement torch<1.6.0,>=1.5.0 (from allennlp==1.0.0) (from versions: 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0) ERROR: No matching distribution found for torch<1.6.0,>=1.5.0 (from allennlp==1.0.0))
  • Run the below command from this link (https://pytorch.org/get-started/previous-versions/)
  • (allennlp_demo) (base) C:>pip install torch==1.5.0+cpu torchvision==0.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
  • After installing torch version 1.5.0 then re-run pip install allennlp==1.0.0
  • In case if you get this error (is typing._ClassVar AttributeError: module 'typing' has no attribute '_ClassVar') then run the below command:
  • (allennlp_demo) (base) C:>pip uninstall dataclasses -y
  • Re-run pip install allennlp==1.0.0
  • Tadaa! You've successfully installed AllenNLP package on your windows machine.

Incase you are installing different version of AllenNLP on windows machine then look for that particular version of allenlp then if you get an error pertaining to torch (ERROR: Could not find a version that satisfies the requirement torch<1.x.x,>=1.x.x) then look for the version of PyTorch on this website [https://pytorch.org/get-started/previous-versions/](Previous PyTorch version)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants