Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Virtual environment path?
#1
In the following paper at this ink:

https://caffeinedev.medium.com/building-...654b10c188

Mr. Prabhat Kumar Sahu

makes the statement:

Output:
For eg: My path is /opt/homebrew/Caskroom/miniforge/base/envs/testcv/ /opt/homebrew/Caskroom/miniforge/base/envs/testcv/bin/python3 You have to change and put your own path there.
When he says your own (my) path what path is he talking about? I assume it is the main path
or what you get when you type

echo $PATH

in windows. It is in the virtual OpenCV environment at the time; is it a particular path for just that environment?

I am using Mac Big Sur 11.4 on Apple M1 cpu.

I am not sure what path to change. Please help.

Also what does

Output:
echo $CONDA_PREFIX
mean in the Apple Big Sur 11.4 operating system?

Respectfully,

LZ
Reply
#2
You do not have to build this yourself as in link.
As you use miniforge install py-opencv
This will install opencv-python and all dependencies packages that may be needed.

So here a run first activate base() or own environment.
See that it install lot which it will not if only build OpenCV yourself.
(miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ conda activate base
(base) (miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ conda install -c conda-forge py-opencv
Collecting package metadata (current_repodata.json): done
......

The following NEW packages will be INSTALLED:

  alsa-lib           conda-forge/linux-64::alsa-lib-1.2.3-h516909a_0
  bzip2              conda-forge/linux-64::bzip2-1.0.8-h7f98852_4
  c-ares             conda-forge/linux-64::c-ares-1.17.1-h7f98852_1
  cairo              conda-forge/linux-64::cairo-1.16.0-h6cf1ce9_1008
  dbus               conda-forge/linux-64::dbus-1.13.6-h48d8840_2
  expat              conda-forge/linux-64::expat-2.4.1-h9c3ff4c_0
  ffmpeg             conda-forge/linux-64::ffmpeg-4.3.1-hca11adc_2
  fontconfig         conda-forge/linux-64::fontconfig-2.13.1-hba837de_1005
  freetype           conda-forge/linux-64::freetype-2.10.4-h0708190_1
  gettext            conda-forge/linux-64::gettext-0.19.8.1-h0b5b191_1005
  glib               conda-forge/linux-64::glib-2.68.3-h9c3ff4c_0
  glib-tools         conda-forge/linux-64::glib-tools-2.68.3-h9c3ff4c_0
  gmp                conda-forge/linux-64::gmp-6.2.1-h58526e2_0
  gnutls             conda-forge/linux-64::gnutls-3.6.13-h85f3911_1
  graphite2          conda-forge/linux-64::graphite2-1.3.13-h58526e2_1001
  gst-plugins-base   conda-forge/linux-64::gst-plugins-base-1.18.4-hf529b03_2
  gstreamer          conda-forge/linux-64::gstreamer-1.18.4-h76c114f_2
  harfbuzz           conda-forge/linux-64::harfbuzz-2.8.2-h83ec7ef_0
  hdf5               conda-forge/linux-64::hdf5-1.10.6-nompi_h6a2412b_1114
  icu                conda-forge/linux-64::icu-68.1-h58526e2_0
  jasper             conda-forge/linux-64::jasper-1.900.1-h07fcdf6_1006
  jbig               conda-forge/linux-64::jbig-2.1-h7f98852_2003
  jpeg               conda-forge/linux-64::jpeg-9d-h36c2ea0_0
  krb5               conda-forge/linux-64::krb5-1.19.1-hcc1bbae_0
  lame               conda-forge/linux-64::lame-3.100-h7f98852_1001
  lerc               conda-forge/linux-64::lerc-2.2.1-h9c3ff4c_0
  libclang           conda-forge/linux-64::libclang-11.1.0-default_ha53f305_1
  libcurl            conda-forge/linux-64::libcurl-7.77.0-h2574ce0_0
  libdeflate         conda-forge/linux-64::libdeflate-1.7-h7f98852_5
  libedit            conda-forge/linux-64::libedit-3.1.20191231-he28a2e2_2
  libev              conda-forge/linux-64::libev-4.33-h516909a_1
  libevent           conda-forge/linux-64::libevent-2.1.10-hcdb4288_3
  libglib            conda-forge/linux-64::libglib-2.68.3-h3e27bee_0
  libiconv           conda-forge/linux-64::libiconv-1.16-h516909a_0
  liblapacke         conda-forge/linux-64::liblapacke-3.9.0-9_openblas
  libllvm11          conda-forge/linux-64::libllvm11-11.1.0-hf817b99_2
  libnghttp2         conda-forge/linux-64::libnghttp2-1.43.0-h812cca2_0
  libogg             conda-forge/linux-64::libogg-1.3.4-h7f98852_1
  libopencv          conda-forge/linux-64::libopencv-4.5.2-py39h70bf20d_1
  libopus            conda-forge/linux-64::libopus-1.3.1-h7f98852_1
  libpng             conda-forge/linux-64::libpng-1.6.37-h21135ba_2
  libpq              conda-forge/linux-64::libpq-13.3-hd57d9b9_0
  libprotobuf        conda-forge/linux-64::libprotobuf-3.16.0-h780b84a_0
  libssh2            conda-forge/linux-64::libssh2-1.9.0-ha56f1ee_6
  libtiff            conda-forge/linux-64::libtiff-4.3.0-hf544144_1
  libuuid            conda-forge/linux-64::libuuid-2.32.1-h7f98852_1000
  libvorbis          conda-forge/linux-64::libvorbis-1.3.7-h9c3ff4c_0
  libwebp-base       conda-forge/linux-64::libwebp-base-1.2.0-h7f98852_2
  libxcb             conda-forge/linux-64::libxcb-1.13-h7f98852_1003
  libxkbcommon       conda-forge/linux-64::libxkbcommon-1.0.3-he3ba5ed_0
  libxml2            conda-forge/linux-64::libxml2-2.9.12-h72842e0_0
  lz4-c              conda-forge/linux-64::lz4-c-1.9.3-h9c3ff4c_0
  mysql-common       conda-forge/linux-64::mysql-common-8.0.25-ha770c72_2
  mysql-libs         conda-forge/linux-64::mysql-libs-8.0.25-hfa10184_2
  nettle             conda-forge/linux-64::nettle-3.6-he412f7d_0
  nspr               conda-forge/linux-64::nspr-4.30-h9c3ff4c_0
  nss                conda-forge/linux-64::nss-3.67-hb5efdd6_0
  openh264           conda-forge/linux-64::openh264-2.1.1-h780b84a_0
  pcre               conda-forge/linux-64::pcre-8.45-h9c3ff4c_0
  pixman             conda-forge/linux-64::pixman-0.40.0-h36c2ea0_0
  pthread-stubs      conda-forge/linux-64::pthread-stubs-0.4-h36c2ea0_1001
  py-opencv          conda-forge/linux-64::py-opencv-4.5.2-py39hef51801_1
  qt                 conda-forge/linux-64::qt-5.12.9-hda022c4_4
  x264               conda-forge/linux-64::x264-1!161.3030-h7f98852_1
  xorg-kbproto       conda-forge/linux-64::xorg-kbproto-1.0.7-h7f98852_1002
  xorg-libice        conda-forge/linux-64::xorg-libice-1.0.10-h7f98852_0
  xorg-libsm         conda-forge/linux-64::xorg-libsm-1.2.3-hd9c2040_1000
  xorg-libx11        conda-forge/linux-64::xorg-libx11-1.7.2-h7f98852_0
  xorg-libxau        conda-forge/linux-64::xorg-libxau-1.0.9-h7f98852_0
  xorg-libxdmcp      conda-forge/linux-64::xorg-libxdmcp-1.1.3-h7f98852_0
  xorg-libxext       conda-forge/linux-64::xorg-libxext-1.3.4-h7f98852_1
  xorg-libxrender    conda-forge/linux-64::xorg-libxrender-0.9.10-h7f98852_1003
  xorg-renderproto   conda-forge/linux-64::xorg-renderproto-0.11.1-h7f98852_1002
  xorg-xextproto     conda-forge/linux-64::xorg-xextproto-7.3.0-h7f98852_1002
  xorg-xproto        conda-forge/linux-64::xorg-xproto-7.0.31-h7f98852_1007
  zstd               conda-forge/linux-64::zstd-1.5.0-ha95c52a_0

The following packages will be UPDATED:

  conda                               4.10.1-py39hf3d152e_0 --> 4.10.3-py39hf3d152e_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
lame-3.100           | 496 KB    | ############################################################################# | 100% 
libdeflate-1.7       | 67 KB     | ############################################################################# | 100% 
xorg-libsm-1.2.3     | 26 KB     | ############################################################################# | 100% 
libclang-11.1.0      | 19.2 MB   | ############################################################################# | 100% 
pixman-0.40.0        | 627 KB    | ############################################################################# | 100% 
krb5-1.19.1          | 1.4 MB    | ############################################################################# | 100% 
fontconfig-2.13.1    | 357 KB    | ############################################################################# | 100% 
libcurl-7.77.0       | 334 KB    | ############################################################################# | 100% 
dbus-1.13.6          | 572 KB    | ############################################################################# | 100% 
glib-2.68.3          | 449 KB    | ############################################################################# | 100% 
xorg-libxdmcp-1.1.3  | 19 KB     | ############################################################################# | 100% 
libssh2-1.9.0        | 226 KB    | ############################################################################# | 100% 
xorg-libxrender-0.9. | 32 KB     | ############################################################################# | 100% 
xorg-xextproto-7.3.0 | 28 KB     | ############################################################################# | 100% 
xorg-libxau-1.0.9    | 13 KB     | ############################################################################# | 100% 
libllvm11-11.1.0     | 29.1 MB   | ############################################################################# | 100% 
nettle-3.6           | 6.5 MB    | ############################################################################# | 100% 
graphite2-1.3.13     | 102 KB    | ############################################################################# | 100% 
xorg-renderproto-0.1 | 9 KB      | ############################################################################# | 100% 
jbig-2.1             | 43 KB     | ############################################################################# | 100% 
lz4-c-1.9.3          | 179 KB    | ############################################################################# | 100% 
libxcb-1.13          | 395 KB    | ############################################################################# | 100% 
c-ares-1.17.1        | 109 KB    | ############################################################################# | 100% 
nspr-4.30            | 233 KB    | ############################################################################# | 100% 
xorg-libx11-1.7.2    | 941 KB    | ############################################################################# | 100% 
hdf5-1.10.6          | 3.1 MB    | ############################################################################# | 100% 
icu-68.1             | 13.0 MB   | ############################################################################# | 100% 
libvorbis-1.3.7      | 280 KB    | ############################################################################# | 100% 
libpq-13.3           | 2.7 MB    | ############################################################################# | 100% 
libopus-1.3.1        | 255 KB    | ############################################################################# | 100% 
xorg-libxext-1.3.4   | 54 KB     | ############################################################################# | 100% 
harfbuzz-2.8.2       | 2.0 MB    | ############################################################################# | 100% 
alsa-lib-1.2.3       | 560 KB    | ############################################################################# | 100% 
bzip2-1.0.8          | 484 KB    | ############################################################################# | 100% 
x264-1!161.3030      | 2.5 MB    | ############################################################################# | 100% 
xorg-xproto-7.0.31   | 73 KB     | ############################################################################# | 100% 
libwebp-base-1.2.0   | 815 KB    | ############################################################################# | 100% 
libogg-1.3.4         | 206 KB    | ############################################################################# | 100% 
gmp-6.2.1            | 806 KB    | ############################################################################# | 100% 
gst-plugins-base-1.1 | 2.6 MB    | ############################################################################# | 100% 
libglib-2.68.3       | 3.1 MB    | ############################################################################# | 100% 
libedit-3.1.20191231 | 121 KB    | ############################################################################# | 100% 
lerc-2.2.1           | 213 KB    | ############################################################################# | 100% 
mysql-libs-8.0.25    | 1.8 MB    | ############################################################################# | 100% 
qt-5.12.9            | 99.5 MB   | ############################################################################# | 100% 
libxml2-2.9.12       | 772 KB    | ############################################################################# | 100% 
openh264-2.1.1       | 1.5 MB    | ############################################################################# | 100% 
cairo-1.16.0         | 1.5 MB    | ############################################################################# | 100% 
libxkbcommon-1.0.3   | 581 KB    | ############################################################################# | 100% 
libuuid-2.32.1       | 28 KB     | ############################################################################# | 100% 
libtiff-4.3.0        | 668 KB    | ############################################################################# | 100% 
libiconv-1.16        | 1.4 MB    | ############################################################################# | 100% 
jpeg-9d              | 264 KB    | ############################################################################# | 100% 
libevent-2.1.10      | 1.1 MB    | ############################################################################# | 100% 
xorg-libice-1.0.10   | 58 KB     | ############################################################################# | 100% 
ffmpeg-4.3.1         | 91.9 MB   | ############################################################################# | 100% 
xorg-kbproto-1.0.7   | 27 KB     | ############################################################################# | 100% 
libnghttp2-1.43.0    | 808 KB    | ############################################################################# | 100% 
libpng-1.6.37        | 306 KB    | ############################################################################# | 100% 
gnutls-3.6.13        | 2.0 MB    | ############################################################################# | 100% 
pthread-stubs-0.4    | 5 KB      | ############################################################################# | 100% 
expat-2.4.1          | 182 KB    | ############################################################################# | 100% 
libprotobuf-3.16.0   | 2.5 MB    | ############################################################################# | 100% 
libopencv-4.5.2      | 34.1 MB   | ############################################################################# | 100% 
gettext-0.19.8.1     | 3.6 MB    | ############################################################################# | 100% 
jasper-1.900.1       | 286 KB    | ############################################################################# | 100% 
zstd-1.5.0           | 490 KB    | ############################################################################# | 100% 
mysql-common-8.0.25  | 1.6 MB    | ############################################################################# | 100% 
conda-4.10.3         | 3.1 MB    | ############################################################################# | 100% 
nss-3.67             | 2.1 MB    | ############################################################################# | 100% 
gstreamer-1.18.4     | 2.0 MB    | ############################################################################# | 100% 
liblapacke-3.9.0     | 11 KB     | ############################################################################# | 100% 
py-opencv-4.5.2      | 1.1 MB    | ############################################################################# | 100% 
libev-4.33           | 104 KB    | ############################################################################# | 100% 
pcre-8.45            | 253 KB    | ############################################################################# | 100% 
glib-tools-2.68.3    | 86 KB     | ############################################################################# | 100% 
freetype-2.10.4      | 890 KB    | ############################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

# Test that it work
(base) (miniforge3-4.10.1-3) tom@tom-VirtualBox:~$ python 
Python 3.9.4 | packaged by conda-forge | (default, May 10 2021, 22:13:33) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> 
>>> cv2.__version__
'4.5.2'
>>> exit()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with creating folder and "virtual environment" AudunNilsen 1 219 Mar-21-2024, 04:41 AM
Last Post: deanhystad
  Installing python packages in a virtual environment Led_Zeppelin 1 759 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  Problem with virtual environment standenman 2 1,005 Feb-23-2023, 07:09 PM
Last Post: standenman
Question Virtual Environment (using VS Code) Ashcora 4 13,674 Feb-15-2023, 07:17 PM
Last Post: snippsat
  How do I link the virtual environment of that project to the 3.9.2 version of python? Bryant11 1 1,369 Feb-26-2022, 11:15 AM
Last Post: Larz60+
  Project structure with a virtual environment gdbengo 1 1,429 Jan-26-2022, 03:22 PM
Last Post: snippsat
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,203 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  virtual environment heye 4 2,445 Jul-04-2021, 06:47 AM
Last Post: ndc85430
  import statement in a virtual environment leodavinci1990 1 2,348 Mar-04-2021, 12:57 AM
Last Post: snippsat
  Virtual environment and upgrading python 3.5 to 3.9 NeilUK 4 12,123 Jan-24-2021, 01:02 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020