Note that once you are inside the venv, you can use the commands pip or python normally. Then your command line will look like the example below, with the name in parentheses confirming that you’re in the venv: (logrocket_env) : _ To make use of the bin file, you have to make sure it’s activated: source. These files guarantee you are in an isolated context of Python configuration. Let’s run the command inside this folder to create our venv: python -m venv logrocket_envĪfter you enter the created folder, you’ll see some other files, such as bin, lib, and share. Remember to always give your directory a good name. Open your preferred IDE to an empty directory and follow along as we begin. This feature basically allows developers to create a folder that’ll act exactly like a specific Python environment. In the article, we’ll also make use of a handy Python feature called venv, also known as Python Virtual Environment. You can avoid this by installing PyEnv to be able to switch which version of Python the python command uses. In this case, you should use python3 instead of python when running commands. In certain environments, you may have have Python 2 and Python 3 installed. If you’re using Linux, chances are that Python is already installed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |