These are chat archives for spyder-ide/public

14th
Jan 2019
Sean
@Sean53941563_twitter
Jan 14 02:01
I just have a quick question about the Spyder IDE. What kinds of information is Spyder communicating over the network? I see network activity for pythonw.exe whenever I open Spyder from the Windows command prompt. I am using Windows 10.
CAM Gerlach
@CAM-Gerlach
Jan 14 02:16
@Sean53941563_twitter Hey, so Spyder actually uses a loopback connection to localhost (127.0.0.1, aka your local machine) in order to communicate with its IPython/Jupyter kernels used to evaluate its code , just like Jupyter notebook, JupyterLab, QtConsole, etc. This allows it to reliably and seamlessly integrate with both kernels started by Spyder and those started externally, across environments, Python installs and even remote machines (if you set it up to connect to a remote kernel). No data is sent outside your local machine unless you manually connect to a remote kernel via SSH. Aside from that, the only network request Spyder makes is an optional once per session update check to if an important update is available, and optionally, should you choose to send it, an issue report to Github if you encounter a critical error so we can fix it. We don't use any telemetry, even a simple one-way ping to track usage numbers, and since Spyder is 100% open source and community developed and funded, you are welcome to take a look at the code yourself and let us know if you have any concerns.
Let us know if you have any more questions!
Sean
@Sean53941563_twitter
Jan 14 02:26
Thank you! Good info. No more questions, I think you pretty much covered everything.
jproy
@jproy
Jan 14 07:17
I can't use cython from inside Spyder editor, it's ok in the Spyder console. Is #%%cython supported (I'm on Mac High Sierra, Spyder 3.3.2). Thanks. I posted in Stackoverflow.
StruSak
@StruSak
Jan 14 07:37
FIRST LINE IS THE CODE ENTERED BY ME. THAT IS:: pa_autoconfigure_django.py --nuke https://github.com/StruSak/my-first-blog.git
PLEASE HELP ME
CAM Gerlach
@CAM-Gerlach
Jan 14 07:37

pythonanywhere bash console

Djangogirls tutorial

Sorry, but could you explain how this has to do with the Spyder data science IDE? I'm not following.

StruSak
@StruSak
Jan 14 07:38
I am a beginner so i don't know
CAM Gerlach
@CAM-Gerlach
Jan 14 07:38

I can't use cython from inside Spyder editor

@jproy Cython should be supported, if I understand correctly. Can you explain specifically what doesn't work?

@StruSak As it says in the title, description and on our website, this is the Gitter chat for the Spyder Python IDE. Are you having a problem with Spyder? Are you even using it?
StruSak
@StruSak
Jan 14 07:40
no
jproy
@jproy
Jan 14 07:41
The following code works fine in the Spyder sonsole but not from Spyder editor.
#%load_ext cython

#%%cython
    cpdef fac(int n):
        if n == 0 : return 1
        return n * fac(n-1)
#%%

print(fac(50000))
What do I miss ? THANKS (it's for a book)
CAM Gerlach
@CAM-Gerlach
Jan 14 07:44
Okay, that's what I thought. In that case, please check out the beginner tutorials for Python, Google your problem, and search Stack Overflow. If you still can't get it resolved (and since you're a beginner, almost certainly someone else has asked the same question many times before online), please find a more appropriate help resource that actually has something to do with your problem, like general Python discussion forums, Django mailing lists/IRCs, PythonAnywhere help, the DjangoGirls group, etc. instead of asking on the help chat for a completly unrelated piece of software you aren't using. Thanks, and best of luck!
jproy
@jproy
Jan 14 07:46
To whom are you answering ? What was your though at least ? A Cython programmer told me that my code should be working.
CAM Gerlach
@CAM-Gerlach
Jan 14 07:46
The above was for @StruSak , sorry.
StruSak
@StruSak
Jan 14 07:47
ok
jproy
@jproy
Jan 14 07:47
Sorry myself, my indent was wrong, it's not the problem...
StruSak
@StruSak
Jan 14 07:47
I did all what you told but all in vain
CAM Gerlach
@CAM-Gerlach
Jan 14 07:48
@jproy The %% are Jupyter/IPython magics which work in the IPython console, but not in a normal .pyx file like you'd write in any editor. For writing proper compiled Cython code, you should follow the standard procedure outlined in the Cython quickstart guide.
jproy
@jproy
Jan 14 07:49
Does it mean that this code does not work in Spyder ? Magic cells are broken ?
CAM Gerlach
@CAM-Gerlach
Jan 14 07:52
@jproy Code cells themselves work fine in Spyder (either Spyder-, Jupyter- or Eclipse- style; you can run the current cell, move between cells, run cell and go to next, and re-run the last cell, etc), and you can use all the magics just like Jupyter Notebook in Spyder's IPython console. The Cython magics don't work in standard .pyx files by design for the same reason that IPython magics naturally don't work in standard non-interactive Python files, because they are intended as shortcuts for quick interactive use rather than for building robust Cython modules that will work consistently and interoperably across all supported Cython platforms rather than just in the IPython interpreter or the walled garden of Jupyter.
All of the magics, Cython, Jupyter, IPython and otherwise, are very explicitly intended for interactive use and have never been designed to be used in reproducible, interoperable, best-practice Python modules.
That said, the Spyter-Notebook plugin allows you to open, edit, run and interact with full Jupyter notebooks from within Spyder, which would presumably enable use of the Cython magics there. Of course, we do recommend you write proper reproducible, interoperable Python source code but that could be a solution for your specific application if you really need it.
CAM Gerlach
@CAM-Gerlach
Jan 14 08:02
@StruSak Sorry, I thought I was clear the first time, but this is the Spyder IDE help chat for questions related to the Spyder IDE, of which your issue appears to lack even the faintest connection to. Not only is the question far off topic, but likely no one on here has any relevant experiance to answer it. Therefore, please, consult the numerous resources available to you and if you must, ask it somewhere more appropriate. Again, thanks and good luck.
StruSak
@StruSak
Jan 14 08:06
ok
CAM Gerlach
@CAM-Gerlach
Jan 14 08:08
Also, please feel to ask any questions related to the Spyder IDE; if you're doing anything related to science, engineering or data analysis, it is definitely the tool you're want to use if you're working in Python and it is also a fully capable environment for general-purpose Python programming and learning Python step by step.
pramodadhikari
@pramodadhikari
Jan 14 18:23
@ccordoba12 I did updated the python and still there is the same problem with the following error message
(base) Pramods-MacBook-Pro:~ pramodadhikari$ spyder
Traceback (most recent call last):
File "/miniconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 3284, in main
mainwindow = run_spyder(app, options, args)
File "/miniconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 3139, in run_spyder
main.setup()
File "/miniconda3/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 844, in setup
from spyder.plugins.editor import Editor
File "/miniconda3/lib/python3.7/site-packages/spyder/plugins/editor.py", line 41, in <module>
from spyder.utils.introspection.manager import IntrospectionManager
File "/miniconda3/lib/python3.7/site-packages/spyder/utils/introspection/manager.py", line 21, in <module>
from spyder.utils.introspection.plugin_client import PluginClient
File "/miniconda3/lib/python3.7/site-packages/spyder/utils/introspection/plugin_client.py", line 18, in <module>
import zmq
File "/miniconda3/lib/python3.7/site-packages/zmq/init.py", line 42, in <module>
_load_libzmq()
File "/miniconda3/lib/python3.7/site-packages/zmq/init.py", line 13, in _load_libzmq
PYPY = platform.python_implementation().lower() == 'pypy'
File "/miniconda3/lib/python3.7/platform.py", line 1263, in python_implementation
return _sys_version()[0]
File "/miniconda3/lib/python3.7/platform.py", line 1224, in _sys_version
repr(sys_version))
ValueError: failed to parse CPython sys.version: '3.7.0 (default, Jun 28 2018, 07:39:16) \n[Clang 4.0.1 (tags/RELEASE_401/final)]'
(base) Pramods-MacBook-Pro:~ pramodadhikari$ python --version
Python 3.7.1
Also, I created separate environment in miniconda and installed spyder there. Spyder worked in that environment, but it's very VERY slow in that env. I have no idea what's wrong within the environment
CAM Gerlach
@CAM-Gerlach
Jan 14 18:27
@pramodadhikari Did you try conda update python python.app pyzmq as I suggested?

Spyder worked in that environment, but it's very VERY slow in that env. I have no idea what's wrong within the environment

Likely due to a known issue with ipykernel on macOS, spyder-ide/spyder#2902 . To fix it for now, run conda install ipykernel=4 in your environment.

pramodadhikari
@pramodadhikari
Jan 14 18:31
@CAM-Gerlach After your suggestion it displays:
(base) Pramods-MacBook-Pro:~ pramodadhikari$ spyder
/miniconda3/bin/pythonw: line 3: /miniconda3/python.app/Contents/MacOS/python: No such file or directory
CAM Gerlach
@CAM-Gerlach
Jan 14 18:32
What does? Conda?
pramodadhikari
@pramodadhikari
Jan 14 18:34
After, conda install ipykernel=4 and conda update python python.app pyzmq
running spyder shows :
/miniconda3/bin/pythonw: line 3: /miniconda3/python.app/Contents/MacOS/python: No such file or directory
CAM Gerlach
@CAM-Gerlach
Jan 14 18:37
I dunno, maybe something is borked with your install. Try conda install -f python python.app
In that environment that produced the error. I don't have access to a macOS machine to test this.
pramodadhikari
@pramodadhikari
Jan 14 18:51
Thanks a lot @CAM-Gerlach It looks like it is working now.
CAM Gerlach
@CAM-Gerlach
Jan 14 19:42
Great to hear!
Carlos Cordoba
@ccordoba12
Jan 14 20:11
Great to know your error was finally fixed @pramodadhikari!