question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows and Sentence Piece

See original GitHub issue

🐛 Bug

Describe the bug

It appears one of the requirements sentencepiece is not built for windows machines.

This causes an import error:

     1 import torch
----> 2 import torchtext
      3 import numpy as np
      4 import pandas as pd

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-dev\lib\site-packages\torchtext\__init__.py in <module>
----> 1 from . import data
      2 from . import datasets
      3 from . import utils
      4 from . import vocab
      5 from . import experimental

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-dev\lib\site-packages\torchtext\data\__init__.py in <module>
      8 from .pipeline import Pipeline
      9 from .utils import get_tokenizer, interleave_keys
---> 10 from .functional import generate_sp_model, \
     11     load_sp_model, \
     12     sentencepiece_numericalizer, \

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-dev\lib\site-packages\torchtext\data\functional.py in <module>
----> 1 import sentencepiece as spm
      2 import re
      3 
      4 __all__ = [
      5     "generate_sp_model", "load_sp_model",

ModuleNotFoundError: No module named 'sentencepiece'

Expected behavior module imports without issue.

Environment

Please copy and paste the output from our environment collection script (or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
python -c "import torchtext; print(\"torchtext version is \", torchtext.__version__)"
  • PyTorch Version (e.g., 1.0): latest
  • OS (e.g., Linux): Windows
  • How you installed PyTorch (conda, pip, source): conda
  • Build command you used (if compiling from source):N/A
  • Python version:3.6
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information: Install torchtext from conda.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
zhangguanheng66commented, Apr 13, 2020

@achapkowski @zhangguanheng66 Is this still a Python-only package? If yes, then you could compile it as a noarch package. See here for more details.

Yes. It’s currently python-only package but we may expand it with some cpp soon. And a noarch package is what we are doing now.

1reaction
peterjc123commented, Mar 19, 2020

It seems the sentencepiece packages are hosted on PyPI. https://pypi.org/project/sentencepiece/0.1.85/#files

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows Support · Issue #178 · google/sentencepiece - GitHub
Although it is not officially announced, Windows support is almost completed and binary package including python-wheel is built on appveyor.
Read more >
sentencepiece - PyPI
Build and Install SentencePiece​​ For Linux (x64/i686), macOS, and Windows(win32/x64) environment, you can simply use pip command to install SentencePiece python ...
Read more >
SentencePiece Tokenizer Demystified | by Jonathan Kernes
It's actually a method for selecting tokens from a precompiled list, optimizing the tokenization process based on a supplied corpus.
Read more >
Sentencepiece - :: Anaconda.org
SentencePiece is an unsupervised text tokenizer and detokenizer mainly for Neural Network-based text generation systems where the vocabulary size is ...
Read more >
Highlight your text - Microsoft Support
The text highlighter on the ribbon in PowerPoint. Choose a color. The text you selected will be highlighted in the color you chose....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found