Hi !
I wrote about this before, however, I never shared the complete set of steps. Here they are.
Install and Update Anaconda
After installing Anaconda, it’s time to update. We need to start Anaconda PowerShell with Administrator privileges.

And then run these commands.
conda update conda
conda update –all
That was easy.
Create a new Virtual Environment
Virtual Environments are an easy way to have different instances on Python and Anaconda to make tests with different packages, different libraries, etc.
Let’s create a new Virtual Environment named “drone”, and let’s activate /switch to the new virtual environment
conda create -n drone tensorflow
conda activate drone
Once we activate the new environment, our PowerShell console should add the [drone] prefix. the following image show the change from [base] to [drone].

Note: Sorry for the crappy interface, new machine and I’m still installing stuff.
Install TensorFlow and OpenCV
The 2 main commands to install the desired packages are
# install TensorFlow
pip install tensorflow --user
# install OpenCV
pip install opencv-python
And that’s it! All the packages should be installed. An easy way to test if both packages are installed is to launch python and
# check tensorflow, and display tensorflow version
import tensorflow as tf
tf.__version__
# check OpenCV, and display OpenCV version
import cv2
cv2.__version__
The output should be similar to this one:

(drone) bruno@W10-EB18ASUS C: WINDOWS system32
❯ python -V
Python 3.9.7
(drone) bruno@W10-EB18ASUS C: WINDOWS system32
❯ python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.6.0'
>>> import cv2
>>> cv2.__version__
'4.5.3'
>>>
Happy coding!
Greetings
El Bruno
More posts in my blog ElBruno.com.
More info in https://beacons.ai/elbruno
References
- Anaconda, https://www.anaconda.com/products/individual
- Tensorflow, https://www.tensorflow.org/
- OpenCV, https://opencv.org/
¿Con ganas de ponerte al día?
En Lemoncode te ofrecemos formación online impartida por profesionales que se baten el cobre en consultoría:
- Si tienes ganas de ponerte al día con Front End (ES6, Typescript, React, Angular, Vuejs…) te recomendamos nuestros Máster Front End: https://lemoncode.net/master-frontend#inicio-banner
- Si te quieres poner al día en Backend (stacks .net y nodejs), te aconsejamos nuestro Bootcamp Backend: https://lemoncode.net/bootcamp-backend#bootcamp-backend/banner
- Y si tienes ganas de meterte con Docker, Kubernetes, CI/CD…, tenemos nuestro Bootcamp Devops: https://lemoncode.net/bootcamp-devops#bootcamp-devops/inicio
1 comment