Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what is the version of packages in requirements.txt #39

Closed
lshowway opened this issue Dec 1, 2021 · 5 comments
Closed

what is the version of packages in requirements.txt #39

lshowway opened this issue Dec 1, 2021 · 5 comments

Comments

@lshowway
Copy link

lshowway commented Dec 1, 2021

hi, when i run python -m pip install --upgrade pip, I fail to install the packages, could you tell us the version of the required packages ?

@gpiat
Copy link

gpiat commented Dec 1, 2021

python -m pip install --upgrade pip will upgrade your installation of pip, not install packages from requirements.txt. You want to run pip install -r requirements.txt for that. If you have trouble:

Create a virtual (or prefarably conda) environment with python 3.6.7.
Replace the second line in the requirements.txt file with:
git+https://github.com/matt-peters/allennlp.git@2d7ba1cb108428aaffe2dce875648253b44cb5ba
try pip install -r requirements.txt, I expect that should work. If it doesn't, you can try specifying the versions of the packages:

pytest==6.2.2
nltk==3.5
ipython==7.16.1
spacy==2.0.18

Hope this helps

@lshowway
Copy link
Author

lshowway commented Dec 2, 2021

@gpiat firstly, i run pip install torch==1.2.0, but when I install allennlp (version is not specified), torch 1.9.1 is then installed.
So what is the version of allnlp.
I recommend more detailed package versions are provided, because when I install allennlp==2.7.0, some file doesn't exist. For example, from allennlp.data import Instance, DataIterator, Vocabulary, DataIterator does not exist.

@gpiat
Copy link

gpiat commented Dec 2, 2021

1.2.0 is the correct version of torch. The version of AllenNLP that is required is 0.8.2 fp16_e_s3. This is specified in the two first lines of the requirements.txt file:

# this is the fp16_e_s3 branch
git+git://github.com/matt-peters/allennlp.git@2d7ba1cb108428aaffe2dce875648253b44cb5ba

You cannot install this version from PyPI, hence the git+git:// requirement which builds the library from source.
Some versions of git won't resolve this type of dependency, and if you are unable to update git (for instance if you're working on a shared computing cluster), this method of installation may fail. That is why I suggest changing to git+https://, which works more consistently.
My version of git is 1.8.3.1. Unless your version of git is older than this, provided you have created your conda environment properly, pip install -r requirements.txt should install all the correct versions of all the dependencies you need.
If that fails, you can exit the kb directory, clone the AllenNLP 0.8.2 fp16_e_s3 repo and install it from source using

git clone https://github.com/matt-peters/allennlp.git
cd allennlp
git checkout fp16_e_s3
pip install -e .

The . is important, it refers to the working directory. Once that's done (if it succeeded), you can comment out the second line of the requirements.txt file and run pip install -r requirements.txt.

This project will not work out-of-the-box with any version of AllenNLP you can get from PyPI. Matthew Peters' fp16_e_s3 branch of AllenNLP implements support for half-precision floats, better support for resource path caching, and better support for querying AWS. If all else fails you may be able to get away with using vanilla AllenNLP 0.8.2 (pip install allennlp==0.8.2) if you replace most references to online resources with local paths in the JSONNET config files for the models. However, I would only recommend this as a last resort.

@lshowway
Copy link
Author

lshowway commented Dec 3, 2021

@gpiat Thank you very much! It helps me solve problems.

@gpiat
Copy link

gpiat commented Dec 9, 2021

My pleasure. Is your problem entirely solved? If so, would you be willing to close the issue, please?

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

No branches or pull requests

2 participants