Forums

Loading Spacy language model.

Hi - I am trying to load a spacy language model for my app:

06:28 ~/learning_map/edugame_maker/APP_CODE (master)$ python3.6 -m spacy download en

Everything seems to be downloading fine, until I get a permission denied message.

running install_lib
creating /usr/local/lib/python3.6/dist-packages/en_core_web_sm
error: could not create '/usr/local/lib/python3.6/dist-packages/en_core_web_sm': Permission denied
----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-2_e2d596-build/setup.py';f=getattr(tokenize, 'open', open)(__fi
le__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-kj2t451r-record/install-reco
rd.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-2_e2d596-build/

Any suggestions on how to resolve this? I tried initiating the same command from various folders.

Thank you in advance.

Hi there, you'll have to install spacy into a virtualenv in order to get a copy that you have write access to, and can download new models for. More info here:

http://help.pythonanywhere.com/pages/Virtualenvs/

So Spacy will be installed twice? once in the virtual environment and once outside. Do I have reload all my requirements?

Thanks

yes, you'll need to load all your other requirements into the virtualenv...

Thank you. Finally up and running. And thank you for a noise free tool.

A couple of things that seem out of whack:

  • Seem to be using a lot of disk space. Wondering if I don't have multiple copies with all my deletes and reinstalls.
  • Running the do something algo seems slower than on my local machine, and that is a 9 year old xeon machine.

Take these observations with a grain of salt. First time running code on a cloud service.

  • try running du -hs /tmp ~/.[!.]* ~/* | sort -h to see where you are using up disk space
  • what does the algo do? if it has a lot of disk access, then it may be slower (your local machine has all it's files accessible locally, but our files are over the network)