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

Add instructions for getting AllenNLP to run on Windows #612

Open
matt-gardner opened this issue Dec 14, 2017 · 54 comments
Open

Add instructions for getting AllenNLP to run on Windows #612

matt-gardner opened this issue Dec 14, 2017 · 54 comments

Comments

@matt-gardner
Copy link
Contributor

matt-gardner commented Dec 14, 2017

It's currently a pain, apparently, and I'm not sure how much work we should do to support it (if you're reading this and want Windows support, add a comment please). But @OyvindTafjord was able to get it actually working by modifying some things:

  1. Got pytorch from 'conda install -c peterjc123 pytorch cuda80' (Add windows support please pytorch/pytorch#494)
  2. Pip install of spacy (and other things) required some VS2015 library stuff (had to be same version as used to compile python).
  3. Pip install of sanic failed (because a dependency, uvloop, is not available for Windows) [ got around it by remove serve from commands ]
  4. In general 'pip install -r requirements.txt' worked weirdly and I ended up running each line individually, I didn't dig into why that was.
  5. Downloading dataset from S3 failed, I think because of non-allowed double quotes in the filename (from the etag) [ got around it by removing etag part of filename]
  6. Download also threw exception because it couldn't remove the temporary file, seems like Windows hangs onto the file for a bit, a 1 second pause didn't help [ got around by catching that exception, deleting the files manually later ]
  7. Had issues getting appropriate tensorflow/tensorboard installed where SummaryWriter was found [ got around it by instead using TensorboardX which somebody made for this purpose ]

I'm going to mark this issue as very low priority, until we hear people actually asking for us to support this. For now, the instructions will just live in this issue.

@sugeknowles
Copy link

+1 for windows support.

@schmmd
Copy link
Member

schmmd commented Dec 21, 2017

3 resolved by #636
5 resolved by #618

@kkhaladk
Copy link

+1 for windows!

@kearnsw
Copy link
Contributor

kearnsw commented Feb 6, 2018

@matt-gardner : updated my allennlp install using pip install allennlp -U and am having the same issue mentioned in number 7 on linux. from tensorboardX import SummaryWriter works but from tensorboard import SummaryWriter throws ImportError: cannot import name 'SummaryWriter'. However the latter is the import call in trainer.py.

@matt-gardner
Copy link
Contributor Author

@kearnsw: Hmm, sadly I don't have any ideas for you, other than maybe there's some helpful information in one of these: #342 #561.

@DeNeutoy
Copy link
Contributor

DeNeutoy commented Feb 6, 2018

@kearnsw this is a version issue, I just experienced the same thing myself. You need pip install tensorboard==1.0.0a6. PR incoming.

@DeNeutoy
Copy link
Contributor

DeNeutoy commented Feb 6, 2018

(you'll also need to uninstall all the other tensorboard distributions you installed, probably, because of namespace clashes etc.)

@AlwaysHungrie
Copy link

+1 for windows

@mtchem
Copy link

mtchem commented Feb 15, 2018

+1 for windows

@ameasure
Copy link

+1 for Windows

2 similar comments
@timbrgr
Copy link

timbrgr commented Mar 25, 2018

+1 for Windows

@cpetroaca
Copy link

+1 for Windows

@jpzhangvincent
Copy link

+1 for windows

@faisalron
Copy link

faisalron commented May 1, 2018

+1 for windows support

@nelson-liu
Copy link
Contributor

nelson-liu commented May 1, 2018

This should hopefully be easier now that PyTorch 0.4 officially supports windows. But SpaCy is still an issue, I think (although last I heard, they were working on it)...

@nelson-liu
Copy link
Contributor

nelson-liu commented May 25, 2018

now that #1232 is in , things should be a lot easier in this regard since most, if not all, paths should be platform-invariant. Perhaps it's time to set up some windows CI and see what goes wrong?

@matt-gardner
Copy link
Contributor Author

@nelson-liu, we should probably wait until the pytorch 0.4 PR is merged next week, at least. And I don't know how to set up a windows CI. Any ideas?

@nelson-liu
Copy link
Contributor

Yeah, sorry --- definitely wait until #1126 is in.

I'm not too sure where the CI configuration lives these days since the switch was made to teamcity, but it should be as "simple" as just setting up a new dockerfile running some variant of windows? Or we could go back to the open-source route and use appveyor

@mvallet91
Copy link

+1 for Windows

Also...it's not completely clear that it doesn't work with Windows in the main page...took me half a day to figure it out hahah

@davidlenz
Copy link

+1 for windows.

@nelson-liu
Copy link
Contributor

nelson-liu commented Jul 16, 2018

Note that jsonnet pip install isn't currently working with windows google/jsonnet#476 , which is another blocker towards support...maybe it'd be worth falling back to json in the event of jsonnet being unavailable?

We'd need something that strips out json-incompatible stuff in the config fixtures, though, like the comments. That should be pretty easy, though...

also looks like spacy linking fails when you don't have admin access on windows, so you can't do spacy.load("en") and have to specify the model explicitly.

@ProxyCausal
Copy link

+1 for windows, resource module doesn't exist

@skadai
Copy link

skadai commented Jul 28, 2018

+1 for windows.. jsonnet cannot be installed using pipT_T

@TPF2017
Copy link

TPF2017 commented Jul 31, 2018

+1 for windows!

@schmmd
Copy link
Member

schmmd commented Mar 25, 2019

@BramVanroy things should mostly work on Windows, although we don't support and test that environment. We're unlikely to prioritize getting AllenNLP working seamlessly on Windows because neither the core development team nor most close collaborators use Windows. That said--we would welcome instructions for how to get AllenNLP running on Windows or people sharing their experience on this thread.

@joelgrus
Copy link
Contributor

if people have specific examples of things that don't work on Windows, it's possible we can address those, but we don't really have the bandwidth to proactively make sure everything works.

@BramVanroy
Copy link

BramVanroy commented Mar 26, 2019

I am running Windows as my daily driver (1080TI), and Linux at work when I have no other choice, i.e. when libraries don't support Windows (K80, soon to be replaced). I definitely understand your standpoint, but as a user I think it is a shame that some of these supercool projects don't get the Windows-treatment. Again, I understand that this is not always feasible from a practical point of view.

I have only used ELMo, so my eperience with AllenNLP is limited. Installing is as straightforward as it is with Linux I suppose:

  1. (Optional) Set up a virtual environment, e.g. with pipenv
  2. Ensure that you have the correct version of PyTorch installed prior to installing AllenNLP. (Not sure what AllenNLP's minimum requirement is, though.)
  3. Ensure that you do not have spaCy 2.1 installed (this will conflict with AllenNLP's < 2.1 version requirement.
  4. Just pip install allennlp, or use a package manager of your choice.

@vamsitharun
Copy link

vamsitharun commented Jul 11, 2019

allennlp 0.7.0 is not working in windows python 3.6
pip install allennlp==0.7.0

torch 0.4.1 is working for me

Error:

ERROR: Could not find a version that satisfies the requirement torch<0.5.0,>=0.4.1 (from allennlp==0.7.0) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch<0.5.0,>=0.4.1 (from allennlp==0.7.0)

Anyone help me please

@BramVanroy
Copy link

You have to install a valid version of pytorch for your platform prior to installing allennlp. See the pytorch getting started web page.

@vamsitharun
Copy link

You have to install a valid version of pytorch for your platform prior to installing allennlp. See the pytorch getting started web page.

I required pytorch==0.4.1 and allennl==0.7.0
Before installing allennlp i installed pytorch 0.4.1 it is working fine. But while installing allennlp i am getting the above mentioned error

@snijesh
Copy link

snijesh commented Oct 30, 2019

pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install allennlp

to install alllennlp on windows, firstly install torch and torchvision using above command. Then install allennlp

@BramVanroy
Copy link

pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

pip install allennlp

Not sure why you posted this. But it's important to know that the installation of torch differs per set-up. See the website for more.

@kunkaweb
Copy link

+1 for windows.

@BramVanroy
Copy link

@kunkaweb It would help if you indicate what isn't working for you on Windows.

@Zhuo-Ren
Copy link

+1 for windows.

1 similar comment
@abhisheksms
Copy link

+1 for windows.

@ghost
Copy link

ghost commented Aug 22, 2020

+1 for Windows!

@akshay1123
Copy link

+1 for windows

@XiaZeng0223
Copy link

+1 for windows.

@danmaxis
Copy link

danmaxis commented Dec 3, 2020

+1 for windows

1 similar comment
@SarneetGit
Copy link

+1 for windows

@LennertDefauw1
Copy link

Create a virtual environement in python and just run the following command:

pip install allennlp==1.0.0 allennlp-models==1.0.0

This worked for me on Windows.

@Martin36
Copy link

+1 for Windows

@dirkgr dirkgr removed the P3 label Feb 18, 2021
@AmazingAbhi
Copy link

+1 for Windows

I am getting this error in Windows:
image

@BramVanroy
Copy link

I don't quite understand the installation issues that people are having and it is hard to debug when everyone is just commenting +1. The steps to install are relatively straightforward, you just have to install the PyTorch wheels separately because (depending on your set up), PyPi will not install fetch the right/wanted wheels for your environmnent if you just do pip install torch. Instead,

  • go to the torch website and set the right toggles, and run the given command;
  • after installation, install allennlp.

If you get warnings or errors about other libraries during the installation of allennlp, you should install those before installing allennlp, plausibly not through pip but via a dedicated method for Windows.

@wcheung-code
Copy link

+1 Windows.

Specifically, my error is involving using the don't stop pretraining repo when trying to build domains using conda env create -f environment.yml from the master branch.

I'm unsure if this is a Windows issue or not, but any resolution here would be greatly appreciated.

If the reproduction of don't stop pretraining can be done on Colab, please let me know. I would greatly appreciate it.

@epwalsh
Copy link
Member

epwalsh commented Oct 7, 2021

@viking-sudo-rm reported that he was able to get AllenNLP working on Windows by installing jsonnetbin.

@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.
Projects
None yet
Development

No branches or pull requests