Jump to content

Beginner struggles...bear with me

Ripred

Hi y'all, to start with if you're easily triggered by painfully noob questions, best to avoid this 馃槅 so I understand the basic concept I'm more interested in your approaches, best practices of when to choose one over the other, also I'm unaware if this is a feature of all other languages but this thought came up in my study of python,..my question is about virtual environments vs system wide environment, I'm currently still learning so forgive my ignorance for the moment, now I understand the basic concept between the two, and some of the ups and downs of each as far as version control, compatibility,so on, I'm more interested ATM of what approach do more experienced take, do you jump right into virtual environment for new projects, or start with system wide, is it purely dependent on the type of project, what type of project would you say best suits each, would you take the same approach on similar projects between personal and professional coding? sorry if this is frustratingly noob but I haven't been coding for very long and recently ran into a small snag, during my study and practice I've just been creating new files in the same project, and I was recently following along with instructions from a book which first asks you to create a new project file, and almost immediately knew I've been overlooking an important detail the second after I typed out my import statement....

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 Ryzen 5800X3D(Because who doesn't like a phat stack of cache?) GPU - 7700Xt

聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽X470 Strix f gaming, 32GB Corsair vengeance, WD Blue 500GB NVME-WD Blue2TB HDD, 700watts EVGA Br

聽~Extra L3 cache is exciting, every time you load up a new game or program you never know what your going to get, will it perform like a 5700x or are we beating the 14900k today? 馃槄~

Link to comment
Share on other sites

Link to post
Share on other sites

I always use virtual environments for Python projects. It's really just a question of whether you want to install libraries for your current project only or for the entire system.

In my experience, they're most useful for managing different versions of libraries. For example, I recently started working on a project that required an older version of a library that I was already using for some other programs. Instead of installing the older version system-wide and potentially having version conflicts, you can just install it in a virtual environment for the one project. In cases like this, the developers will include a requirements.txt file which contains a list of libraries to use and their version numbers. This makes it super easy to get a new virtual environment up and running with just a few commands.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

I also second always using a virtual environment for every project! You save yourself a lot of hassle that way.

If you don't want to use venv for it, I really liked using anaconda. It is able to even install non python dependencies that are needed for packages.

But using them or not, is more of a efficiency thing. If you continue to just do everything system wide, you will eventually run into a very annoying problem. And figure out, that it would be easier to just setup virtual environments for each of your projects after the fact, compared to trying to fix it system wide. So ... no matter how much you avoid virtual environments, they will almost surely find you and force you to use them.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now