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

Model symlinks not working on Windows (Python 2.7) #909

Closed
solresol opened this issue Mar 23, 2017 · 2 comments
Closed

Model symlinks not working on Windows (Python 2.7) #909

solresol opened this issue Mar 23, 2017 · 2 comments
Labels
bug Bugs and behaviour differing from documentation help wanted (easy) Contributions welcome! (also suited for spaCy beginners) windows Issues related to Windows

Comments

@solresol
Copy link
Contributor

It's not exactly spaCy's fault. It looks like it's a pathlib problem creating symlinks on Windows.

Anyway, on a fairly fresh Win2k8 (an Amazon workspaces desktop, in fact) pip install spacy works as long as the compiler is in place.

python -m spacy download en fails with the following error message:

Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in run_code
exec code in run_globals
File "c:\python27\lib\site-packages\spacy_main
.py", line 71, in
plac.Interpreter.call(CLI)
File "c:\python27\lib\site-packages\plac_ext.py", line 1142, in call
print(out)
File "c:\python27\lib\site-packages\plac_ext.py", line 914, in exit
self.close(exctype, exc, tb)
File "c:\python27\lib\site-packages\plac_ext.py", line 952, in close
self._interpreter.throw(exctype, exc, tb)
File "c:\python27\lib\site-packages\plac_ext.py", line 964, in make_interpreter
arglist = yield task
File "c:\python27\lib\site-packages\plac_ext.py", line 1139, in call
raise
(task.etype, task.exc, task.tb)
File "c:\python27\lib\site-packages\plac_ext.py", line 380, in wrap
for value in genobj:
File "c:\python27\lib\site-packages\plac_ext.py", line 95, in gen_exc
raise
(etype, exc, tb)
File "c:\python27\lib\site-packages\plac_ext.py", line 966, in make_interpreter
cmd, result = self.parser.consume(arglist)
File "c:\python27\lib\site-packages\plac_core.py", line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "c:\python27\lib\site-packages\spacy_main
.py", line 45, in link
cli_link(origin, link_name, force)
File "c:\python27\lib\site-packages\spacy\cli\link.py", line 14, in link
symlink(origin, link_name, force)
File "c:\python27\lib\site-packages\spacy\cli\link.py", line 50, in symlink
link_path.symlink_to(model_path)
File "c:\python27\lib\site-packages\pathlib.py", line 1167, in symlink_to
self._accessor.symlink(target, self, target_is_directory)
TypeError: symlink() takes exactly 3 arguments (4 given)

I've written up a solution over here: http://stackoverflow.com/questions/42914239/spacy-english-model-install-is-failing

I think what's going wrong is that pathlib's symlink function doesn't work correctly on Windows.

Your Environment

  • Operating System: Windows
  • Python Version Used: 2.7
  • spaCy Version Used: 1.7.2
  • Environment Information:
@ines ines added bug Bugs and behaviour differing from documentation help wanted (easy) Contributions welcome! (also suited for spaCy beginners) windows Issues related to Windows labels Mar 23, 2017
@ines
Copy link
Member

ines commented Mar 23, 2017

Thanks for the report and getting to the bottom of this!

That's pretty annoying... just did a quick search and there seem to be some general problems with symlinks and Python 2 on Windows. So we might need to add a little Windows-only workaround. Unfortunately, we don't have a good Windows testing environment at the moment, so I'll be tagging this as "help wanted" in case one of our Windows users wants to give this a go in the meantime (would be much appreciated!).

@ines ines changed the title Downloading of models fails for python2.7 on Windows 6.1 (and probably other versions) Model symlinks not working on Windows (Python 2.7) Mar 23, 2017
solresol added a commit to solresol/spaCy that referenced this issue Mar 25, 2017
ines added a commit that referenced this issue Mar 25, 2017
@ines ines closed this as completed Mar 25, 2017
@lock
Copy link

lock bot commented May 9, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation help wanted (easy) Contributions welcome! (also suited for spaCy beginners) windows Issues related to Windows
Projects
None yet
Development

No branches or pull requests

2 participants