Mi sono sempre chiesto se fosse possibile eseguire PyPy nel taccuino Jupyter. Recentemente ho provato a installare PyPy sul mio computer locale, e ha funzionato molto bene: accelerazione 100X in una simulazione basata su agenti scritta in puro Python. Tuttavia, mi manca l'interattività nel taccuino Jupyter. È possibile far sì che il kernel IPython usi PyPy piuttosto che CPython?È possibile eseguire un kernel pypy nel notebook Jupyter?
11
A
risposta
6
È possibile installare Jupyter con PyPy:
pypy-pip install jupyter
L'sono problemi su Mac OS X. Se l'installazione fallisce lamentando una su gnureadline
. Prova questo:
pypy-pip install --no-deps jupyter
Than iniziare con:
pypy-ipython notebook
mio pypy-ipython
assomiglia a questo:
#!/usr/local/bin/pypy
# -*- coding: utf-8 -*-
import re
import sys
from IPython import start_ipython
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(start_ipython())
In un quaderno:
In [1]: import sys
In [2]: sys.version
Out[2]:
'2.7.9 (295ee98b6928, May 31 2015, 07:28:49)\n[PyPy 2.6.0 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]'
Il notebook richiede Python 2.7 o 3.3+. PyPy per Python3.3 dovrebbe essere presto disponibile.
mio pypy-pip
questo file eseguibile /usr/local/bin//pypy-pip
con questo contenuto:
#!/usr/local/bin/pypy
# EASY-INSTALL-ENTRY-SCRIPT: 'pip','console_scripts','pip'
__requires__ = 'pip'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('pip', 'console_scripts', 'pip')()
)
Problemi correlati
- 1. Errore kernel in R Notebook con Jupyter Notebook
- 2. Jupyter: non è possibile creare un nuovo blocco note?
- 3. Notebook Jupyter/IPython: collegamento per "eseguire tutti"?
- 4. jupyter notebook in esecuzione kernel in env diverso
- 5. registrazione di kernel in ipython/jupyter notebook - kernel.json
- 6. La simpatia di sympy è interrotta nel nuovo notebook jupyter?
- 7. Posiziona ipywidgets in HTML nel notebook Jupyter
- 8. Esporta singola cella nel notebook IPython/Jupyter
- 9. Link ambiente Conda con Jupyter Notebook
- 10. Utilizzo di Spark Kernel su Jupyter
- 11. Elenco numerazione markdown notebook Jupyter
- 12. Notebook Jupyter: utilizzo della memoria per ogni notebook
- 13. Impossibile eseguire la funzione principale di unittest nel notebook ipython/jupyter
- 14. Posso eseguire celle notebook Jupyter in linea di comando?
- 15. Jupyter Scala Kernel mancante
- 16. collapse cell in jupyter notebook
- 17. Jupyter & PySpark: come eseguire più quaderni
- 18. Come documentare l'avvio del profilo Jupyter Notebook?
- 19. Esegui Jupyter Notebook in Background su Docker
- 20. Notebook Jupyter rotto da Python 3.5
- 21. È possibile visualizzare un video OpenCV all'interno del notebook IPython/JuPyter?
- 22. Notebook Ipython (jupyter), opencv (cv2) e tracciamento?
- 23. modello predefinito per ipython notebook (utilizzando Jupyter)
- 24. un nuovo thread per eseguire una cella in un notebook ipython/jupyter
- 25. Widget HTML in Jupyter R Notebook
- 26. È possibile eseguire un traceroute nel browser?
- 27. Utilizzo di ipython magics in R jupyter notebook?
- 28. Impossibile creare cluster ipyparallel su Jupyter Notebook
- 29. Un notebook Jupyter/IPython può accettare argomenti nell'URL?
- 30. Impossibile utilizzare Jupyter Notebook: jsonschema apparentemente mancante
Grazie per la risposta, Mike! Come posso ottenere lo strumento 'pypy-pip'? Al momento ho già pip e setuptools installati per pypy e pypy3, configurati all'incirca nello stesso modo dell'anaconda Python (in una directory separata sotto la mia cartella home). – ericmjl
Mi scuso per aver postato questo secondo veloce ... ma mi sono reso conto che posso fare 'pypy -m pip install package_name' o' pypy3 -m pip install package_name' solo dopo aver postato il mio commento. – ericmjl
Aggiunto il contenuto di 'pypy-pip'. –