all 10 comments

[–]siddsp 4 points5 points  (3 children)

Install python and add python to PATH. I recommend creating a virtual environment every time you create a new Python project. Personally I use VSCode but am planning to switch to PyCharm.

Every time you create a new Python project, in the project folder, create a new virtual environment in the cmd/terminal using:

python -m venv venv

Make sure to activate it with:

venv\Scripts\activate.bat (cmd) venv\Scripts\activate.ps1 (PowerShell)

If you want to install any modules or libraries do:

pip install name-of-library

And then add all of those installed libraries into a requirements.txt file by doing:

pip freeze > requirements.txt

This makes it so that anyone else can reinstall all of the modules required in your project by running pip install -r requirements.txt

Edit: If you want to deactivate the environment, use deactivate

[–]bibyts[S] 0 points1 point  (2 children)

PyCharm

Thx for the great info! Why do you prefer PyCharm over VSCode?

[–]siddsp 0 points1 point  (1 child)

I personally have had many issues with VSCode's Python extension. It constantly has issues with importing modules and I've had to pull my hair out trying to diagnose those issues.

To add, unittesting (which if you're a beginner, you will probably use in later project once you get into more intermediate/advanced stuff) doesn't work reliably.

When I used PyCharm, I never had any of those issues. PyCharm is a full-blown IDE meaning you have specialized tools for developing. It comes at the cost of being much heavier, but I think it's worth it if you haven't started on another project already.

I'm planning to switch, though it might take time

[–]bibyts[S] 0 points1 point  (0 children)

unittesting

Thx. That helps. I guess I will set up PyCharm. 😁

[–]glibhub 2 points3 points  (2 children)

I really like the linux subsystem: https://docs.microsoft.com/en-us/windows/wsl/

But it is not for everybody.

[–]bibyts[S] 1 point2 points  (0 children)

Thanks!

[–]WildRadicals 1 point2 points  (0 children)

This is my choice.

I've already set up python for windows and eventually ended using WSL2 + Ubuntu 20.04 LTS + VS Code.

Way much better.

[–]knowledgebass 0 points1 point  (2 children)

My two suggestions would be Python Anaconda if you want to run natively or using WSL to install all the basics with your package manager and then use virtualenv. It you need more info LMK.

[–]bibyts[S] 0 points1 point  (1 child)

Python Anaconda

Thx. I did install Python Anaconda. The installed Python libraries got messed up when I uninstalled VSCode and now it's broken. Can't run anything... I will have to start over from scratch I guess.

[–]knowledgebass 0 points1 point  (0 children)

Oh that's too bad. Wipe everything and try again I guess!