Starting to Learn Python: Development Tools and Environments

  • Python
  • Thread starter PeroK
  • Start date
  • Tags
    Python Tools
  • Featured
In summary: Thanks! I'll check it out. I'm mostly just looking for a general purpose editor with decent support for Python.Eclipse is a good choice.
  • #36
FactChecker said:
Have you considered getting a single-board computer like Raspberry Pi?
I haven't.
 
Technology news on Phys.org
  • #37
Mark44 said:
It's not necessary to be using an IDE with Python to get debugging capabilities. You can step through the code from the command line using the PDB debugger that comes with Python distributions. I wrote two Insights articles on how to use this tool.
https://www.physicsforums.com/insights/simple-python-debugging-pdb-part-1/
https://www.physicsforums.com/insights/simple-python-debugging-pdb-part-2/

To be honest, that's a couple of insights I have not read. Thanks for giving me that info.
 
  • #38
PeroK said:
I haven't.
I bought one back in April and it was a lot of fun, but ended up burning it out two months later. You can install python on windows just fine and use visual studio which is a great IDE.
 
  • Like
Likes FactChecker and PeroK
  • #39
Borg said:
Anaconda with Jupyter Notebooks.
This is mostly, AFAIK, for Data Science/Analytics. @PeroK : Any specific goal/focus in learning Python ? Edit: There are other more " neutral ones" like Idle ( Part of the Python theme, I guess: Idle--Eric ). I was having some conflict for a while using versions 2,3 at the same time. When you make a request to the back end server , at least from Anaconda, the system got confused on which of the servers 2,3 would handle/serve the request.
 
  • #40
WWGD said:
This is mostly, AFAIK, for Data Science/Analytics. @PeroK : Any specific goal/focus in learning Python ? Edit: There are other more " neutral ones" like Idle ( Part of the Python theme, I guess: Idle--Eric ). I was having some conflict for a while using versions 2,3 at the same time. When you make a request to the back end server , at least from Anaconda, the system got confused on which of the servers 2,3 would handle/serve the request.
I've no programming project in mind, but I wanted to be able to write some mathematical scripts to help when looking at various problems. I assumed Python would be quick and easy to get started with.
 
  • #41
That's Python's strength: you can produce functional, usable code very quickly.

Ensuring that code runs fast, on the other hand, is something of an art. Python can run fast, but sometimes doesn't. There are a lot of opportunities for bottlenecks.
 
  • #42
PeroK said:
I've no programming project in mind, but I wanted to be able to write some mathematical scripts to help when looking at various problems. I assumed Python would be quick and easy to get started with.
In that case, download python from the Windows store and an editor (Notepad++ is nice) and start coding. You will almost certainly want numpy and scipy, but their webpages have install instructions.

Worry about IDEs when you're writing large projects.
 
  • #43
Well with Anaconda you get everything in a single package (python with numpy, scipy, IDE,...) which is good enough to start and also for more advanced topics.
I agree with Ibix, that if you want GUI programming the built-in Tkinter is.. well let's just say, not appealing :)
 
  • #44
On linux and Mac python is part of the system and it can easily be broken. I would suggest looking into virtual environments. The value is that if you screw one up just delete it and start afresh. I hate IDEs. They just get in the way typically.
 
  • #45
Just to recap, we are on Windows (read the OP) and at the advice from at least two posters in this thread experienced in multiple environments have recommended FOR THIS USE CASE the Anaconda installation which comes packaged with Jupyter Notebooks and/or PyCharm which is a cut-down version of a commercial product.

Python package management in Windows is a mess, and it is far quicker to let the Anaconda or Intellij installer set this up so it works than debug a self-installation of Python and pip or conda.
 
  • #46
pbuk said:
Python package management in Windows is a mess, and it is far quicker to let the Anaconda or Intellij installer set this up so it works than debug a self-installation of Python and pip or conda.

I disagree about package management on Windows being a mess. I use git bash and python venv on Windows and it works very smoothly. I totally get a preference for other tools, but one can work very efficiently without them.
 
  • Like
Likes atyy and Paul Colby
  • #47
Locrian said:
I disagree about package management on Windows being a mess. I use git bash and python venv on Windows and it works very smoothly. I totally get a preference for other tools, but one can work very efficiently without them.
That's great, I'm glad it works for you. Have you ever tried to fix it for someone else, remotely, with an unknown environment state?
 
  • Like
Likes atyy
  • #48
(of course whilst this discussion has being continuing, the OP has just been getting on with coding in Python - good for you @PeroK)
PeroK said:
PS I've downloaded Pycharm and will see how that goes.
 
  • #49
pbuk said:
That's great, I'm glad it works for you. Have you ever tried to fix it for someone else, remotely, with an unknown environment state?

As long as Python and git bash are installed, this would just be typing three lines into the bash terminal.

There's nothing special about Python package management on Windows. Venv even uses the same syntax as Linux (the only difference being the activation script is stored in youenvfolder/Scripts instead of yourenvfolder/bin). If memory serves me, conda environment management uses the same syntax in git bash and linux as well, though I haven't needed conda for a couple of years.
 
  • Like
Likes Paul Colby
  • #50
Locrian said:
As long as Python and git bash are installed, this would just be typing three lines into the bash terminal.

There's nothing special about Python package management on Windows. Venv even uses the same syntax as Linux (the only difference being the activation script is stored in youenvfolder/Scripts instead of yourenvfolder/bin). If memory serves me, conda environment management uses the same syntax in git bash and linux as well, though I haven't needed conda for a couple of years.
The problem is that in Windows there is no such thing as "yourenvfolder".

pip or conda looks for packages in the locations that are set in the PATH (or is it Path now? was it ever case sensitive anyway?) env variable visible to the current application instance, and the only way this is going to be set right is if whatever you used to install Python put them there and there is not some other install that has overwritten them or put another version over the top or higher up the precedence or on another user or in an inaccessible Admin user or in a bespoke "Python" shortcut or somewhere else.
 
  • #51
pbuk said:
The problem is that in Windows there is no such thing as "yourenvfolder".

Sure there is!

Here's the exact code I would type to create and activate it in git bash:

Code:
python -m venv envs/physicsforum
source envs/physicsforum/Scripts/activate

The first line creates a "phsysicsforum" folder in my "envs" folder. Envs is where I keep all my environments; you can put yours somewhere else. You can even place it in your repo, though that's generally inadvisable. You might need to do so if you're leveraging lambda or other serverless tool.

The second line activates that folder in my path, just as you say needs to be done.

When I'm done with that environment, i can activate another one or type "deactivate" to return to defaults.

I keep an activate.env bash script in each of my repos that does the "source" command, so I don't have to type it in every time.
 
  • Skeptical
Likes pbuk
  • #52
Locrian said:
Sure there is!...
I don't doubt that your solution works for you, however it is solving a different problem to the one we are discussing here, namely:
  • Starting to Learn Python
  • I've never programmed (or done anything technical) on Windows
  • I don't want to get into installing Linux at this stage
 
  • #53
I haven't suggested installing linux, just git bash. If you don't like the git bash terminal, you can use the windows terminal to do the same thing (it will even give you that option when you install git bash).

The important thing I want folks to take away from this is that there's nothing magical about the Python environment. There's no Windows Python package management system or something like that.

Python package management consists of
1) A folder (with a specific subfolder structure)
2) A way to get code into that folder, compiling when necessary (and with the right structure)
3) A way to point Python to that folder

There are programs that obscure this in the name of ease, and there's nothing wrong with using them. . . until they don't work. Then if you don't understand what's happening behind the scenes, it can all seem very mysterious and hard to solve.
 
  • #54
python actually comes with a very simple "ide" on windows.
 
  • #55
Dr Transport said:
Spyder coupled with Anacondais a good IDE. I use it all the time and it has served me well. Works on both Windows and Linux.
How is Spyder different from Jupyter notebooks?
 
  • #56
WWGD said:
How is Spyder different from Jupyter notebooks?

I couldn't tell you, I've never used a Jupyter notebook.
 
  • Like
Likes WWGD
  • #57
Spyder is a different experience than a notebook - it isn't a web application, and doesn't have the same options for graphics, narrative text, etc. within the code. However, like a notebook, it does keep a kernel running, which can allow for some very nice debugging options. Spyder will feel more like Pycharm to those used to Jupyter.

My only complaint with Spyder is that, for reasons that I cannot fathom, it takes absolutely forever to spin up on my work machine. Like, 3-10 minutes. It comes right up at home, so I assume it's the anti-virus or some similar program getting in the way.
 
  • Like
Likes WWGD

Similar threads

Replies
1
Views
3K
Replies
8
Views
2K
Replies
3
Views
701
Replies
3
Views
1K
Replies
13
Views
2K
Replies
6
Views
2K
Replies
6
Views
1K
Replies
14
Views
5K
Back
Top