These are chat archives for spyder-ide/public

23rd
Jun 2018
CAM Gerlach
@CAM-Gerlach
Jun 23 2018 02:45
I wrote a whole long post answering your questions and then my trackpad glitched when trying to click edit, which deleted it instead with no confirmation or undo. Great Ux, Gitter...
CAM Gerlach
@CAM-Gerlach
Jun 23 2018 02:51

is it just like having a virtual machine in which to test things and make mistakes in ?

More or less. virtualenv/venv and conda-env both allow you to create isolated environments in which to install packages and their dependencies that won't affect any other environments, the default/base environment, or your system at large. Additionally, conda-env allows you to also install different Python versions and other (C/++...) compiled binaries into different environments, and supports conda-installed packages as well as pip ones (venv/virtualenv only handles the latter), so it should almost always be used in preference to that if you have it.

do i need one to get the most out of spyder

Not at all, but it can really help you manage your packages, Python versions and Spyder itself to deal with different scenarios, test things out and avoid/easily recover from issues, particularly using pip. Spyder 4 will include many expanded features in this regard built right in to make all this even easier.

if anaconda doesnt have the python package i want to use in spyder, will a virtual env / conda env make any difference ?

Not directly, since either way you can just install from a different conda channel (conda-forge, package author's channel, development channel, custom channel, etc), or you can just install it with pip. However, if you do either ideally but particularly the latter, it is strongly recommended to do so in an isolated environment to minimize the possibility of pip messing something up, as it often does (Anaconda or not) particularly with the compiled packages and dependencies commonly found with scientific and data analysis libraries.

CAM Gerlach
@CAM-Gerlach
Jun 23 2018 03:02

another alternative would be to use another IDE like pycharm and try to use the needed packages there with the help of pip ?

There is no need to choose another IDE, as this does not directly affect your choice of packages or installation methods. Spyder doesn't intrinsically care how packages were installed so long as they are associated with the Python environment you set it to use in Spyder's preferences, which like Spyder itself can be installed via pip or conda (though we strongly recommend the latter). However, even this is not necessary or recommended, since as mentioned you can just install packages with pip under an Anaconda environment just like you would with any other Python install, with little to no risk of anything going wrong at least if you do so in a clean conda-env environment), and then either launch Spyder in or point it to that environment.

Paul Gureghian
@paulgureghian_twitter
Jun 23 2018 18:23
Think Ill just use spyder when I can and pycharm when I need to, and just stick with base / default envs for both out of the box. the thing with pycharm is I have to point it to my python interpreter, with spyder I dont think I had to do that.
CAM Gerlach
@CAM-Gerlach
Jun 23 2018 19:36

pycharm when I need to

Just so we know, what sort of applications do you prefer PyCharm for, and/or what do you see as its main features/draws over Spyder? There's defintely plenty of good reasons to use it for certain projects, particularly application development, but we're curious what our users miss most from Spyder and what they'd most like to see us work on next.

just stick with base / default envs for both out of the box

Well, this is alright if you are only working on one or a few closely related projects, and don't plan to install any packages with pip, mix Python versions, use a lot of compiled/external binaries, etc. But for anything else, proper environments take very little time to set up and can save you a ton down the road. Also, I recall you asking about getting packages that aren't on conda, and it is strongly recommended you use seperate environments if installing via pip to avoid all kinds of potential trouble. I didn't use them at first either, but they are really worth it in the end, once your projects scale up or you attain a long trail of dependencies over time.

the thing with pycharm is I have to point it to my python interpreter, with spyder I dont think I had to do that.

Right, though you can easily set your interpreter in Spyder's preferences if you so choose.

Paul Gureghian
@paulgureghian_twitter
Jun 23 2018 21:43
I do mainly data analysis / machine learning / scripting. I dont really know enough to like one over the other, having to point pycharm to an interpreter can be intimidating to new users (I just figured it out) , both have ipython consoles, git bash (unix) terminals, VCS. I would love to get my hands dirty with creating venvs / conda envs but it seems a bit involved right now and I dont want to try to use google to figure it out and im sure you guys have other things to do other than hold my hand. as for setting the interpreter in spyder or pycharm for that matter to anything but the default for spyder or python.exe for pycharm, what would be the benefit ?
CAM Gerlach
@CAM-Gerlach
Jun 23 2018 22:42

data analysis / machine learning / scripting. I dont really know enough to like one over the other

Something to note is that Spyder has always been specifically designed for this use case, and offers the Variable Explorer, integration with scientific packages, interactive plotting, more powerful IPython console features, various data analysis tools, Numpydoc support, several other related features and is written right in Python itself and is much lighter to run; also, a number of plugins are availiable or in development for it, particularly those that extend its capabilities in the data science arena. On the other hand, PyCharm currently has more powerful debugging, completion/introspection, project, etc support (although Spyder 4 will have major improvements in all these areas), for people building larger applications and systems in Python. If you're still a beginner in the Python world, and don't see a compelling advantage to either, I'd just pick one and stick with it for now (seems like Spyder would be a very good fit for your needs) and stick with it until you're at the point where you can make a more educated decision.

I would love to get my hands dirty with creating venvs / conda envs but it seems a bit involved right now

Fair enough, I didn't either when I started out since I really didn't need to for my use case. But if you need to install pip packages or otherwise want a clean environment or don't want a package change to affect an existing one, then creating one is as easy as conda-env create -n <new-env-name>, and thereafter you can activate it with activate <new-env-name> (on Windows) or source activate <new-env-name> on other platforms. Or, if even that's too intimidating, you can do it all in the Anaconda Navigator GUI, or in the GUI of a forthcoming release of Spyder 4 right inside the IDE itself. And of course, there's no need to bother with venvs/virtualenvs for now since you're using Anaconda.

having to point pycharm to an interpreter can be intimidating to new users (I just figured it out)

If someone is at the point where they don't understand what an interpreter is or which environment they are using, then it is really best for them to learn that first before getting their hands dirty with Python itself, since a lot of things beyond just simple scripts (for which an IDE is massive overkill) will not go well if that understanding is not there first.

I dont want to try to use google to figure it out

Other than trial and error and, as you say, going to others for help, how else does one figure things out these days if not with the mighty Google (and its friend Stack Exchange)?

as for setting the interpreter in spyder or pycharm for that matter to anything but the default for spyder or python.exe for pycharm, what would be the benefit ?

Well, if you wanted to use a different Python environment/version/install than the one you started Spyder under, or the one you have currently selected for Pycharm. In Spyder this is mostly not necessary for most usecases right now since you can simply launch Spyder in the relevant environment, but in the future you can install spyderkernels in that environment and then work in it "remotely" with the Spyder from any other environment.