开发者

How to install NLTK on my webserver

Ok I edited my question since I now have a host that does support ssh.

How can i install the nltk module for python using ssh?

I tried contacting support but they can't seem to help me. You guys any ideas? How can I install modules in general on my webserver? what's the hosting's equivalent of sudo python开发者_StackOverflow中文版 setup.py install?


You will need shell access (though not necessarily root access) to properly install a Python module.

However, since you're able to execute Python code on the remote, you might be able to set up a script that you can run through a web browser that runs python setup.py install --home=DIR for NLTK on the remote, where DIR is a directory on your PYTHONPATH where you have write access. (This solution should be considered a crude hack, though.)

EDIT: forget the above, good that you have shell access. Make a dir ~/apps (or similar), put that in the PYTHONPATH of the account used to run your Python web serving code (not necessarily your own, please check first) and install it in that dir using the home scheme.


In addition to @larsmans' instructions, you probably will also need to download relevant data for your NLTK installation. To do that, run the following after you successfully install the module:

$ python
>>> import nltk
>>> nltk.download()

This function will then guide you through the process of downloading the corpora.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜