Define an Environment VariableĪs a first step, I set up an environment variable for the installation directory. It turns out that it takes a bit of digging to accomplish that, so I created this detailed guide to save my readers (and my future self) some effort. I prefer to have everything in one place, so I wanted to add an Anaconda profile to the PowerShell instead of running it on a different shell. #Run python script from anaconda prompt installpip install opencv-python Successfully install opencv on your system You can use CV2 by just importing it in your python script. Installation of CV2:-Open the command prompt. If you happen to be a windows user and a programmer, chances are you are using PowerShell a flexible command-line prompt that allows you to run different environments as tabs. Like read an image, write an image, convert colored to gray, binary, HSV etc. You don't have to specify the python version because the script is running inside the Anaconda environment. Executing the python script python fileName.py. #Run python script from anaconda prompt macLike the Mac system, accessing terminal on a Linux system is also very easy. After the conda environment has been activated, the slug of the environment appears between round brackets next to your terminal prompt. Switch to the environment with conda activate environmentName. All you need to do is open Launchpad and search for Terminal, and in the terminal, type Python and boom, it will give you an output with the Python version. Chances are that your operating system has a default Python installation somewhere, and Anaconda wants to avoid library clashes.Ĭonsequently, anaconda comes with each own shell, installed as ‘Anaconda Prompt’. Create required Anaconda environment Include all your dependencies at once while creating the environment. If you are a user of the Anaconda Python development environment, you probably know that Anaconda likes to keep its executables separate from the general system executables. Running Python scripts by using Anaconda prompt.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |