For a long time, I didn't understand how to use Virtual Environments in Python π.
If this is just, let's end it here and now: π§΅π
[2] Virtual Environments let you deal with the dependencies that your code has with external Python libraries.
It avoids having conflicts when your projects depend on different versions of the same library.
π
[3] Let's imagine that you are building your first Python project and you install the "requests" library:
pip install requests
You get version 2.24.0 installed in your system.
π
[4] A month later, you decide to work on your second project. It also needs the "requests" library.
But the latest version is not 2.24.0 anymore.
Now version 3 is available, and that's the one you want to use!
π
[5] You could upgrade your entire system to version 3, but then you'll be potentially breaking the first project you built that depends on 2.24.0!
Can you imagine this happening on a server with many more applications running?
π
[6] Virtual environments solve this problem.
The first step for every new project is to create a virtual environment for it.
Some people have a central location where they store all environments. I prefer to keep them inside the project folder.
π
[7] You can create a new virtual environment with Python 3 using the following command:
python3 -m venv .myvenv
Then, you can use "source" to activate the environment.
At this point, you'll have full isolation for your project.
π
[8] If you install any libraries within a virtual environment, they will never mess with the libraries installed at the system level or other virtual environments.
Before starting, remember that, if you follow me, one of your enemies will be immediately destroyed (and you'll get to read more of these threads, of course.)
And if you don't follow me, well, you just hurt my feelings.
π
1. Labels
(Also referred to as "y")
The label is the piece of information that we are predicting.
For example:
- the animal that's shown in a picture
- the price of a house
- whether a message is spam or not
Rumors are going around that Twitter cripples tweets that include links.
There's nothing in their official documentation, but a lot of people think that's the case.
I thought this through, and I will not play along.
π§΅π
Allegedly, if I disable the links, my tweets will get much more impressions because Twitter will push them to more people.
Assuming this is the case, what's the cost?
My followers will have to start copying, then pasting any links that I post.
(2 / 4)
Seems like a small nuance, but reading comments on tweets with disabled links, the process is very error-prone and a lot of people have trouble accessing the content.