PyCharm and Virtual Environment

bkanber
4 min readMay 30, 2021

Creating Virtual Environment through Terminal

With an 8-minute video, I explained to you how to create a virtual environment from scratch via the terminal, install a library and delete the virtual environment we created. Thanks for watching.

What is this Pycharm?

Pycharm is an IDE (Integrated Development Environment) program created for python. It gathers all development tools in one place and offers powerful and easy use. It has two different versions; Professional and Community. The Professional version is paid but provides one-year free use for students. The community version is completely open-source and free.

It is one of the tools that can be used to use the Python programming language. Interfaces such as Microsoft Visual Studio Code, Atom, Jupyter notebook, Jupyterlab can be used.

What are the advantages of using PyCharm?

1- Jupyter Notebook can be used.
2- It can also output data or graphs.
3- We can see the resulting dataframes in the data view without printing them. Large and small values ​​can be highlighted.
4- The terminal is at hand.
5- Git integration and version control tracking. Opportunity to see repositories operations and changes in the interface with one click
6- Supporting many special file formats such as readme.md, make, requirements.txt, and routing for effective use
7- Easy virtual environment and dependency management.
8- Easy to re-factor
9- Being able to follow the object very easily
10- Being able to work with Chunk logic
11- Debug feature. You can add debug points to certain points and examine the code behavior at those points.
12- File directory operations are much easier.
13- Path capture, ability to open terminal or folder in the desired directory
14- Being able to control PEP8 automatically.
15- It can scan all codes with the Inspect code section and report errors. (Code -> Inspect Code)

What are Virtual Environments?

https://www.syfy.com/syfywire/solar-opposites-justin-roiland-mike-mcmahan-wall-episode-7

To create an isolated environment. One of the ways to isolate data science projects at the library level is to create a virtual environment. It is used to create different environments for different projects. We use it to isolate projects that may have different needs.
For example: Let’s say we want to write a game in python with pygame.
For example, pygame does not know how to work with 3 series, it can work with 2 series.
Let’s say that the pygame with environment 3.7 version we just created cannot work with 3. Our problem starts here. Let’s say all our applications are working with the 3 series, we can’t go back to the 2 series just for this application, so what should we do? We create an isolated environment for pygame.

Tools with functionality to create and manage Virtual Environment
1- venv(part of the standard library)
2-virtualenv (Widely-used)
3-pipenv(high-level interface)
4-conda(not only for python)

What is the concept of Dependency Management?

https://www.activestate.com/resources/quick-reads/dependency-management-with-pip/

When we include the pandas library in our work, there are many libraries that pandas depends on. For example, pandas runs on top of NumPy and many submodules work. When we install with pip install pandas, there is a world in the back. only pandas is not installed.

1- Management of Loyalties
2- Package Management
manages dependencies of libraries or packages.

pip(requirements.txt)
pipenv(pipfile)
conda(environment.yml)

Pip and Conda are two commonly used package management, dependency management tools.
Conda is a tool used for both package management and virtual environment installation.
We can say conda > pip.

What is the relationship between virtual environments and package management tools?
Conda is a virtual environment management tool.
Venv and virtualenv use pip as their package management tool.
Pipenv and conda can do both package management and virtual environment management.

As a result:
Conda can be used for package management and virtual environment management.
Pip can be used for package management.
Usually, pip and conda are used.

pip: PyPI(python package index) package management tool
What is a pip?
PyPI(python package index) is a package management tool.
It is short for PyPI.
When we download a library using pip, we are actually downloading it from the python package index. We can write our own library, publish it.

I would like to thank my teacher Mustafa Vahit Keskin and my mentor Mehmet for their contributions.

--

--