These are chat archives for spyder-ide/public

7th
Aug 2018
Carlos Cordoba
@ccordoba12
Aug 07 2018 00:09
@dakyion, sure, you can. I programmed simulations for the solar system, Brownian motion, etc
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 00:40
will 3.3.1 be on anaconda tomorrow or just pip ?
Sergiu IT
@itsergiu
Aug 07 2018 14:26
How can I explore objects during debugging like I explore variables?
In IPython consle I use vars(my_object), this is a prompt way. I want a GUI way for Object like Variable explorer.
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 15:28

I want a GUI way for Object like Variable explorer.

As a matter of fact, Spyder has one, exactly like the Variable Explorer: it's called...the Variable Explorer! If you can't see them, make sure Exclude unsupported data types is not selected under the "Gear" menu in the top right of the pane.

@itsergiu Most arbitrary objects should work, although there may occasionally be a few bugs for more esoteric ones. Even better support will be coming in Spyder 4.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 16:53
Is 3.3.1 out today ? will it be on conda today? if not, I need to install spyder with pip ? will that installation clash with my current installation?
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 16:58
@paulgureghian_twitter Sorry, I thought I answered you but my message must not have sent. It certainly won't be on conda today; it hasn't even been released to pip yet and it takes some time (usually a few days, sometimes a week) for Anaconda to get around to building it. We strongly advise you just wait a few days for it to be out on conda if that's what you're currently using, as you are correct it will likely clash with your current install. If you absolutely have to have it sooner, you should create a fresh environment (with conda create -n your-name-here python=3.6 and activate it), and then pip install spyder in that, until you can update your existing Anaconda install.
However, you may still run into issues in the build itself due to pip not dealing too well with non-Python dependencies and such, and if that happens there's not much we can do to help.
If you do get it working, with the changes in 3.3.0/3.3.1, you can just point your pip 3.3.1 Spyder at your other environment to work with the packages within, or any other environment so long as spyder-kernels is installed. Check out our new guide on the subject for more.
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 17:03
In the meantime, if you want to track the release progress yourself, keep an eye on the 3.3.1 milestone; if that's still open, the final release process hasn't started yet.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 17:47
Just answer me this if you can: How to use spyder 3.3.1 or 3.3.0 with python 2. I tried a conda env and pointed spyder at it, spyder needed spyder kernels so i tired conda prompt and that failed then i installed it with navigator, but spyder still could not start a kernel / ipython session.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 17:54
I used navigator to install spyder / kernels in my conda python2 env. is it better / different to use pip to install spyder / kernels ?
If im able to do that, then point spyder 3.3.0 at that interpreter?
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 18:01
@paulgureghian_twitter , @ccordoba12 already explained this to you. There is a (IPython/Jupyter-related?) bug in 3.3.0 that prevents it from properly communicating with spyder-kernels in other environments. Also, always use conda to install packages under Anaconda unless you have no other option but to use pip, as the latter can lead to a lot of problems. Finally, make sure you are installing the correct version of Spyder kernels for Spyder 3: the correct install command you should be using is conda install spyder-kernels=0.* .
Also, the guide I linked previously explains all of this. It all will be much easier in Spyder 4, we promise :)
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 18:04
Will spyder4 just be easier, or will it the ultimate update / upgrade in regards to this issue?
spyder 4*
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 18:05
Well, you shouldn't have "this issue" at all (i.e. not being able to communicate with a kernel in another environment, assuming spyder-kernels is properly installed) once 3.3.1 comes out in a day or two.
I'm not sure how you define "ultimate upgrade", but if everything is executed as planned it should be a dramatic improvement with a full GUI for managing packages and environments right inside of Spyder, equalling or surpassing Anaconda Navigator (which itself was originally created by the Spyder project).
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 18:11
im working on a project where the scripts were written in python2 so to avoid extensive refactoring / revision i need a py2 env.
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 18:30
Okay; again, once Spyder 3.3.1 comes out it should work; in fact, I just tested in right now with a Github clone of Spyder 3 latest running in a Python 3 env, installed spyder-kernels in a Python 2 env, changed the interpreter in Spyder preference to point to it, and opening a new console and executing print foo worked just fine.
Although, to wit, Python 3 has been out for ten years this December, Python 2 hasn't seen a major update for over eight, and it will be fully end of life on Jan 1 2020 (less than a year and a half) with Spyder (with the new Spyder 5) dropping support on or before that date and much of the PyData ecosystem has done so already; almost all of the broader package ecosystem supports Python 3 (>95% of the top 100-300 packages, before the various websites stopped counting because the transition was essentially complete). Furthermore, successive versions of Python 3 (particularly 3.4, 3.5 and 3.6) have made it successively easier to port over your code, and it really isn't that hard and can be mostly done automatically. Therefore, if you are still stuck on Python 2 only...well, its really time to start moving on.
@paulgureghian_twitter Otherwise, you'll be stuck at the end having to rush the transition, and the sooner you do it the more benefits you'll reap and the easier it will be.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 18:34
im just not skilled enuff i dont think to port 2 to 3
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 18:43
@paulgureghian_twitter Sure you are, if you could write the code in the first place! Unless you're doing a lot of string/bytes manipulation or dealing with OS/network boundaries/interfaces, etc., the differences are mostly just semantic and don't typically require too much thought. Furthermore, for typical use cases (likely including yours) most or all of the required changes can be done automatically by just running your code through packages like e.g. futureize, and then Spyder's built-in pylint static analyzer can check your code for any remaining issues. See the official Python 3 porting guide for more.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 18:43
do i need spyder kernels and spyder or just kernels ?
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 18:45
Just spyder-kernels (0.x), in any environment you want to use with Spyder. You only need Spyder (3.3.1) installed in one environment on your machine; you can even use it with totally different Python installs if you want.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 18:49
do i have to be in exact spot of the py2 env in my terminal in the file structure ?
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 18:54
No, you can be anywhere you want. You just need to set Tools -> Preferences -> Python interpreter -> Use a different Python interpreter to point to the python.exe of the environment you want (should be under envs/your-py2-env-name/python.exe under your Anaconda directory).
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 18:58
Image 2.png
it says in essence that spyder kernels are already installed. i just created this env and i didnt install anything into it yet
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:00
Good, then you already have it. Now just to wait for Spyder 3.3.1's release (or, you can always just install Spyder itself with conda directly in that environment and use it from there, so long as pip hasn't messed anything up).
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:01
so i cant do anymore til 3.3.1 is released to conda, other than install spyder via pip and point that at the conda env interpreter ?
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:01
You didn't activate the environment, as you can see to the right (it still says base). You tried to install spyder-kernels in your base environment where you already have it. Activate it with activate your-env-name-here.

As I just said,

you can always just install Spyder itself with conda directly in that environment and use it from there, so long as pip hasn't messed anything up.

Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:01
i navigated to the py2 location
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:03
Okay ... ?
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:03
i need to be in python2 not just base in the py2 location
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:05
Like I just said, that doesn't matter. What does matter, as I also just said in reply to your last comment, is you need to activate the python2.7 environment. So, like I also just said, enter the following command: activate python2.7 and try installing again. However, it may or may not work until Spyder 3.3.1 is released, as I have just said several times, so you can always just conda install spyder into that environment and use it from there, and it should work.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:07
i was a bit confused about just installing spyder by itself with pip or conda. i think i got now. create a py2 env, put kernels there, then use conda to put 3.3.0 there.
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:09

Yes, except for the last step,

put kernels there, then use conda to put 3.3.0 there.

is either-or. You can either install Spyder kernels and use it with the Spyder in your base environment once 3.3.1 comes out (or you can try it now; I thought the problem was only connecting with externel kernels rather than starting new ones by changing the interpreter path anyway). OR, you can install spyder 3.3.0 in that env (conda install spyder, which will install spyder-kernels with it so you can use it with your other Spyder as well) and it will work with that Spyder.

If the latter, to launch the correct environment's Spyder you need to first activate it as above, and then type spyder to launch it.
But hopefully it works with the former.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:11
if i already have kernels and i install spyder will that work. or just start from scratch?
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:12
Yes, that will work fine. But you may as well try it now with your other Spyder to see if it works (change the Tools -> Preferences -> Python interpreter -> Use a different Python interpreter path to your other env's Python as instructed, and open a new console instance).
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:18
so, this is my understanding: create an env, activate it, install kernels for later use, or just install spyder directly in
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:18
Yes
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:19
so, we really dont need pip then ?
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:19
Nope, not if you can at all help it.
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:20
thanks. think i got it now.
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 19:20
Glad to help :+1:
Paul Gureghian
@paulgureghian_twitter
Aug 07 2018 19:51
just one more thing about pip. i would only need / want to use pip if it had something that conda didnt have. as in spyder 3.3.1. if pip has it but conda doesnt, and i dont want to wait for conda to have it, i install spyder with pip and point it at my conda py2 env or py3 base env or some other python.exe , or use pip to install spyder 3.3.1 directly into the conda py2 env or py3 base env?
CAM Gerlach
@CAM-Gerlach
Aug 07 2018 20:04
You can find most mainstream packages that the conda defaults channel doesn't have in conda-forge, i.e. conda install -c conda-forge your-package-name. However, it is best not to mix the two, so like pip, you should always create a new, isolated environment for that purpose.

i install spyder with pip

In a new environment, yes.

use pip to install spyder 3.3.1 directly into the conda py2 env or py3 base env?

Definitely not either of those, since installing it into the conda py2 env defeats the point (you could have just installed 3.3.0 with conda and it would have worked just as well), and you never, ever want to install stuff into your base env with pip since that can screw up your entire conda install.