简体   繁体   中英

How do I run 'python -m' command in jupyter

Some imports eg spacy need me to run:

python -m spacy download de_core_news_sm

How do I manage to make this happen from within a cell in jupyter lab?

Or can I simply put this in a requirement.txt file?

The goal is to make a notebook run without installing something extra, but the requirements file.

You simply run these command in the cell by putting a "!"before the line of code

ex.

! python -m spacy download de_core_news_sm

this will work.

Happy Coding!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM