GithubHelp home page GithubHelp logo

Comments (46)

hamelsmu avatar hamelsmu commented on June 4, 2024 475

@ClaudeCoulombe try this in your terminal

python -m spacy download en

does that work?

from seq2seq_tutorial.

LargoTerranova avatar LargoTerranova commented on June 4, 2024 54

For those using Anaconda I found the following solution to install the en package and link it succesully:

  1. Right clik on the Anaconda Promt Icon
  2. Go to "More" and click on "Open as Administrator"
  3. Then type: python -m spacy download en

It worked for me

from seq2seq_tutorial.

Saravana08 avatar Saravana08 commented on June 4, 2024 25

Hi, your solution (python -m spacy download en) worked perfectly, but it says download successfull but linking failed!
can you please help me.

from seq2seq_tutorial.

Saravana08 avatar Saravana08 commented on June 4, 2024 25

Hi, this got resolved when i opened the cmd prompt as an Administrator, kindly open anaconda as an admin and then run the same commands, it should work.

from seq2seq_tutorial.

ClaudeCoulombe avatar ClaudeCoulombe commented on June 4, 2024 15

Maybe an answer to many people.

python -m spacy download en works only if you have administration rights, the installation folder should have admin rights

from seq2seq_tutorial.

ClaudeCoulombe avatar ClaudeCoulombe commented on June 4, 2024 11

Yess, it works! Thanks for your pretty fast answer!

I've tried with pip3 install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz --no-depswith no success.

But python -m spacy download enworks well. For the moment, I'm waiting after the preprocessing which seems to be long and memory consuming. I'm better to switch to cloud... I think...

I'll close the issue.

from seq2seq_tutorial.

venkey143228 avatar venkey143228 commented on June 4, 2024 8

from seq2seq_tutorial.

julomoppet avatar julomoppet commented on June 4, 2024 7

@venkey143228
@AnujaySaraf
@theSaumya
same issue with me, but for some reasons when I do spacy.load('en_core_web_sm') it does work...

from seq2seq_tutorial.

koliko avatar koliko commented on June 4, 2024 6

python -m spacy download en shows /usr/bin/python: No module named spacy

from seq2seq_tutorial.

sean-m-higgins avatar sean-m-higgins commented on June 4, 2024 4

Im using Python 3.6 and "python3 -m spacy download en" while in my site-packages directory worked for me!

from seq2seq_tutorial.

KIC avatar KIC commented on June 4, 2024 2

Same here.

python -m spacy download de_core_news_md
Requirement already satisfied: de_core_news_md==2.1.0 from https://github.com/explosion/spacy-models/releases/download/de_core_news_md-2.1.0/de_core_news_md-2.1.0.tar.gz#egg=de_core_news_md==2.1.0 in c:\programdata\anaconda3\lib\site-packages (2.1.0)
✔ Download and installation successful
You can now load the model via spacy.load('de_core_news_md')

but actually loading it fails with

lib\site-packages\spacy\util.py in load_model(name, **overrides)
    134     elif hasattr(name, "exists"):  # Path or Path-like to model data
    135         return load_model_from_path(name, **overrides)
--> 136     raise IOError(Errors.E050.format(name=name))
    137 
    138 

OSError: [E050] Can't find model 'de_core_news_md'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

I am using spacy 2.1.3 via coda on windows

from seq2seq_tutorial.

zhangzexdu avatar zhangzexdu commented on June 4, 2024 2

I installed the spacy and used python3 -m spacy download en to link successfully.
Linking successful
/Users/kindler/anaconda3/lib/python3.6/site-packages/en_core_web_sm -->
/Users/kindler/anaconda3/lib/python3.6/site-packages/spacy/data/en

You can now load the model via spacy.load('en')

If I use the terminal python command line it will be load normally, but use the pycharm in the same virtualenv environment it will report an error.

/Users/kindler/.virtualenvs/allennlp_latest/bin/python /Users/kindler/Documents/Projects/2019/4/preprocessing_dataset/processing/FewRel/preprocessing.py
Loading the json files ...
Traceback (most recent call last):
  File "/Users/kindler/Documents/Projects/2019/4/preprocessing_dataset/processing/FewRel/preprocessing.py", line 24, in <module>
    main()
  File "/Users/kindler/Documents/Projects/2019/4/preprocessing_dataset/processing/FewRel/preprocessing.py", line 12, in main
    dataloader = JSONDataLoader()
  File "/Users/kindler/Documents/Projects/2019/4/preprocessing_dataset/processing/FewRel/data_loader.py", line 17, in __init__
    self.nlp = spacy.load("en")
  File "/Users/kindler/.virtualenvs/allennlp_latest/lib/python3.6/site-packages/spacy/__init__.py", line 21, in load
    return util.load_model(name, **overrides)
  File "/Users/kindler/.virtualenvs/allennlp_latest/lib/python3.6/site-packages/spacy/util.py", line 119, in load_model
    raise IOError(Errors.E050.format(name=name))
OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Can someone help me with this?

Thanks .

from seq2seq_tutorial.

Zugamund avatar Zugamund commented on June 4, 2024 2

For those using Anaconda I found the following solution to install the en package and link it succesully:

  1. Right clik on the Anaconda Promt Icon
  2. Go to "More" and click on "Open as Administrator"
  3. Then type: python -m spacy download en

It worked for me

Thank so muuuuch SamCurtis111 !

from seq2seq_tutorial.

rtehporp avatar rtehporp commented on June 4, 2024 1

@venkey143228
Maybe you should use sudo python -m spacy download en on linux.
Or you should use administrator cmd to run python -m spacy download en on windows.

from seq2seq_tutorial.

ranjankumar-gh avatar ranjankumar-gh commented on June 4, 2024 1

Worked when I run Anaconda Prompt as an Administrator. Thanks

from seq2seq_tutorial.

vipul2001 avatar vipul2001 commented on June 4, 2024 1

While using command
python -m spacy download en
the package 'en_core_web_sm' automatically comes into the picture and get installed
Also, it is better to use en_core_web_sm instead of en for models

from seq2seq_tutorial.

rajatscibi avatar rajatscibi commented on June 4, 2024 1

For those using Anaconda I found the following solution to install the en package and link it succesully:

1. Right clik on the Anaconda Promt Icon

2. Go to "More" and click on "Open as Administrator"

3. Then type: `python -m spacy download en`

It worked for me

i tried everything and this worked finally!! thank you

from seq2seq_tutorial.

Anujay-Saraf avatar Anujay-Saraf commented on June 4, 2024

Hi , Its giving me the same issue, after downloading it says linking failed

from seq2seq_tutorial.

theSaumya avatar theSaumya commented on June 4, 2024

I am logged in through the Admin account, but it still getting the linking error.

from seq2seq_tutorial.

Heng-Qi avatar Heng-Qi commented on June 4, 2024

Thanks,

@ClaudeCoulombe try this in your terminal

python -m spacy download en

does that work?

Thanks,it works for me.

from seq2seq_tutorial.

WrathofBhuvan11 avatar WrathofBhuvan11 commented on June 4, 2024

Thanks,

@ClaudeCoulombe try this in your terminal

python -m spacy download en

does that work?

Thanks,it works for me.

No it says it can't link

from seq2seq_tutorial.

ChenMus avatar ChenMus commented on June 4, 2024

Hi,it have showed linking successfully, but when I print 'nlp = spacy.load('en')' in prompt,it doesn't work ..

from seq2seq_tutorial.

hamelsmu avatar hamelsmu commented on June 4, 2024

@koliko are you running this code inside the provided docker container? if not, looks like you do not have spacy installed, so you will have to first install spacy

pip install spacy

from seq2seq_tutorial.

venkey143228 avatar venkey143228 commented on June 4, 2024

Good evening sir,
I am beginner to spacy..
i installed spacy successfully and en module too.
but when am load the en module the following error came.

import spacy
nlp=spacy.load('en')
txt=nlp("hello world")
print(txt)

error: OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

from seq2seq_tutorial.

venkey143228 avatar venkey143228 commented on June 4, 2024

from seq2seq_tutorial.

adhamKahlawi avatar adhamKahlawi commented on June 4, 2024

I did all this
Right clik on the Anaconda Promt Icon
Go to "More" and click on "Open as Administrator"
Then type: python -m spacy download it_core_news_sm
but I have the same error
OSError: [E050] Can't find model 'it_core_news_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

from seq2seq_tutorial.

vicky-arumugam avatar vicky-arumugam commented on June 4, 2024

Exception:
Traceback (most recent call last):
File "C:\python\lib\site-packages\pip_internal\cli\base_command.py", line 176, in main
status = self.run(options, args)
File "C:\python\lib\site-packages\pip_internal\commands\install.py", line 346, in run
session=session, autobuilding=True
File "C:\python\lib\site-packages\pip_internal\wheel.py", line 848, in build
assert building_is_possible
AssertionError

from seq2seq_tutorial.

syafiqzolkeply avatar syafiqzolkeply commented on June 4, 2024

Hi,

I really need help with the installation of en model. I have successfully installed spacy using the following command:

sudo conda install -c conda-forge spacy (since everyone suggested to login as administrator)

But when I want to install the en model using the following command:

sudo python -m spacy download en

I received the following errors:

Traceback (most recent call last):
File "/Users/mycomputer/anaconda3/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Users/mycomputer/anaconda3/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/Users/mycomputer/anaconda3/lib/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/spacy/init.py", line 12, in
from .cli.info import info as cli_info
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/spacy/cli/init.py", line 1, in
from .download import download # noqa: F401
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/spacy/cli/download.py", line 11, in
from .link import link
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/spacy/cli/link.py", line 9, in
from .. import util
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/spacy/util.py", line 5, in
import pkg_resources
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 3191, in
@_call_aside
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 3175, in _call_aside
f(*args, **kwargs)
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 3219, in _initialize_master_working_set
for dist in working_set
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 3219, in
for dist in working_set
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2726, in activate
declare_namespace(pkg)
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2252, in declare_namespace
_handle_ns(packageName, path_item)
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 2185, in _handle_ns
loader.load_module(packageName)
File "./google.py", line 15, in
model = gensim.models.keyedvectors.KeyedVectors.load_word2vec_format('GoogleNews-vectors-negative300.bin', binary=True)
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/gensim/models/keyedvectors.py", line 1119, in load_word2vec_format
limit=limit, datatype=datatype)
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/gensim/models/utils_any2vec.py", line 173, in _load_word2vec_format
with utils.smart_open(fname) as fin:
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/smart_open/smart_open_lib.py", line 181, in smart_open
fobj = _shortcut_open(uri, mode, **kw)
File "/Users/mycomputer/anaconda3/lib/python3.6/site-packages/smart_open/smart_open_lib.py", line 301, in _shortcut_open
return open(parsed_uri.uri_path, mode, buffering=buffering, **open_kwargs)
FileNotFoundError: [Errno 2] No such file or directory: 'GoogleNews-vectors-negative300.bin

Can someone help me with this?

Thanks

from seq2seq_tutorial.

masterchop avatar masterchop commented on June 4, 2024

Thanks,

@ClaudeCoulombe try this in your terminal

python -m spacy download en

does that work?

Thanks,it works for me.

No it says it can't link

You need to do sudo python -m spacy download en

from seq2seq_tutorial.

mario-marques avatar mario-marques commented on June 4, 2024

It worked for me too, thank you!

from seq2seq_tutorial.

RyanBe123 avatar RyanBe123 commented on June 4, 2024

I tried all the methods above and it didn't work, what finally worked for me was ensuring I was installing spacy==2.0.13 (from issue #2849). Now if i spacy.load('en') it works and it links. When I start python in the anaconda prompt box, import spacy and type spacy.load('en') then run it, it works. However, when, I try and run it in my spyder console (3.3.5) using a environment running python 3.6, where Spacy is also installed, I get the same error:

OSError: [E050] Can't find model 'en'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Anyone know why there is a discrepnacy between my IPython console on spyder and my anaconda prompt?

from seq2seq_tutorial.

qmeeus avatar qmeeus commented on June 4, 2024

On linux this worked for me:
First install the module without sudo rights with python -m spacy download nl_core_news_sm
Then, to import it:

import os.path as p
import spacy

env_path = p.join(p.expanduser("~/.local/bin/anaconda3/envs/<env-name>"))
path_to_module = p.join(env_path, "lib/python3.7/site-packages/nl_core_news_sm/nl_core_news_sm-2.1.0")

nlp = spacy.load(path_to_module)

I think this can (and should) be fixed by using the name of the executable to find the module in scipy.load, something like:

import sys, os

def find_model(model_name):
    path_to_env = p.abspath(p.join(sys.executable, "../.."))
    path_to_modules = p.join(path_to_env, f"lib/python{sys.version[:3]}/site-packages")
    path_to_model = p.join(path_to_modules, model_name)
    if not p.exists(path_to_model):
        raise FileNotFoundError(path_to_model)
    model_dir = [d for d in os.listdir(path_to_model) if d.startswith(model_name)][0]
    return p.join(path_to_model, model_dir)

find_model("nl_core_news_sm")

from seq2seq_tutorial.

jakaseptiadi avatar jakaseptiadi commented on June 4, 2024

i have to try this "python -m spacy download en", but still doesn't work. It says "Download successful but linking failed". Anyone can help me to fix this problem?

from seq2seq_tutorial.

masterchop avatar masterchop commented on June 4, 2024

i have to try this "python -m spacy download en", but still doesn't work. It says "Download successful but linking failed". Anyone can help me to fix this problem?

Maybe a permission problem?
also there are different way to get that, you may want to try:

python -m spacy download en_core_web_sm

from seq2seq_tutorial.

ptiwari2407 avatar ptiwari2407 commented on June 4, 2024

Okay, I had the same problem, but i figured out the solution:
'en_core_web_sm' : us ethis when you're not admin
'en' : can be used when you are admin. .

Linking fails because of admin rights over your system, but it's no big deal you can use the other counter-part.

from seq2seq_tutorial.

kkairu avatar kkairu commented on June 4, 2024

python -m spacy download en

@hamelsmu This works perfect on windows running anaconda

from seq2seq_tutorial.

iamamjad avatar iamamjad commented on June 4, 2024

Try this hopefully it will work on my case i am using mac OS
python -m spacy download en_core_web_lg

from seq2seq_tutorial.

raghav103 avatar raghav103 commented on June 4, 2024

@koliko are you running this code inside the provided docker container? if not, looks like you do not have spacy installed, so you will have to first install spacy

pip install spacy

Sir, I have installed spacy as well but it is still showing that there no module named spacy

from seq2seq_tutorial.

raghav103 avatar raghav103 commented on June 4, 2024

@koliko are you running this code inside the provided docker container? if not, looks like you do not have spacy installed, so you will have to first install spacy

pip install spacy

@hamelsmu Sir, I have installed spacy as well but it is still showing that there no module named spacy

from seq2seq_tutorial.

hamelsmu avatar hamelsmu commented on June 4, 2024

Please search on stack overflow

from seq2seq_tutorial.

marcelogere avatar marcelogere commented on June 4, 2024

Download successful but linking failed
Creating a shortcut link for 'es' didn't work (maybe you don't have admin
permissions?), but you can still load the model via its full package name: nlp =
spacy.load('es_core_news_sm')

This is how it worked for me!!! Thank you!!!

from seq2seq_tutorial.

SamCurtis111 avatar SamCurtis111 commented on June 4, 2024

This wasnt working for me after trying all of the above solutions.
To make it work I did the following:

  1. Right-click on Anaconda prompt -> run as administrator
    1.1) python -m spacy download en
  2. Right-click on Spyder -> run as admistrator
    Then once inside spyder (as admin) i was able to:
    import spacy
    nlp = spacy.load('en')

from seq2seq_tutorial.

sowmyaarajan avatar sowmyaarajan commented on June 4, 2024

Hi, this got resolved when i opened the cmd prompt as an Administrator, kindly open anaconda as an admin and then run the same commands, it should work.

Yes! This works. Open the anaconda env as an administrator.

from seq2seq_tutorial.

Baludatascience avatar Baludatascience commented on June 4, 2024

Hi, if still any one has issue with this, try to download with full name:

python -m spacy download en_core_web_sm --user

will work.

from seq2seq_tutorial.

AndrexYT avatar AndrexYT commented on June 4, 2024

Thanks,

@ClaudeCoulombe try this in your terminal

python -m spacy download en

does that work?

Thanks,it works for me.

No it says it can't link

Run console as admin!

from seq2seq_tutorial.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.