Reinstall opencv will bug the entire project for opencv import - amazon-sagemaker

I was trying to install opencv-contrib-python but had trouble getting a hold of img_hash.
When I try to reinstall opencv-python, it seems to mess up the entire cnoda enviornment. Is there any way to reset the environment from scratch?
import cv2
!pip uninstall -y opencv-python
!pip uninstall -y opencv-contrib-python
!pip install opencv-python
!pip install opencv-contrib-python
hsh = cv2.img_hash.BlockMeanHash_create()
cv2.imread('image.png')
hsh.compute(a_1)
Error:
~/.conda/envs/default/lib/python3.9/site-packages/cv2/gapi/__init__.py in <module>
288
289
--> 290 cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline
AttributeError: partially initialized module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline' (most likely due to a circular import)

Related

Undefined subroutine &main::open_quote called at /usr/local/bin/autom4te line 262

Hi I try to install xdebug via pecl on macox (Big Sur 11.5.2)
But I get error message
xdebug volodymyr$ pecl install xdebug
downloading xdebug-3.0.4.tgz ...
Starting to download xdebug-3.0.4.tgz (215,870 bytes)
.............................................done: 215,870 bytes
87 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Undefined subroutine &main::open_quote called at /usr/local/bin/autom4te line 262.
ERROR: `phpize' failed
I update perl but it did help me (I can't catch if the open_quote is a part of perl)
Also I didn't find any information in the internet that is related with open_quote function issue
I tried to install xdebug from source and get the same bug on the ./phpize step
Resolve:
Just reinstall autoconf automake libtool
I run
brew reinstall autoconf automake libtool
After that I run brew link --force autoconf and it resolved the trouble
The error here comes from autom4te, not pecl or ./phpize. You need to update automake and autoconf, and/or related packages.

having an issue creating new react app with create-react-app

I am trying to create a new react project, but when I run npx create-react-app tik-tok-clone I get the following error
Creating a new React app in C:\Users\mwars\Documents\GitHub\TikTok-Clone\tik-tok-clone.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
error postcss#8.1.3: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.12.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts cra-template --cwd C:\Users\mwars\Documents\GitHub\TikTok-Clone\tik-tok-clone has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting tik-tok-clone/ from C:\Users\mwars\Documents\GitHub\TikTok-Clone
Done.
I've been trying to figure it out for a while now and just can't get it to work.
I am was dealing with the same problem and have managed to understand and fix it. I will try to explain it below.
The issue:
error postcss#8.1.3: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.12.0"
This is telling you that the create_react_app module is only compatible with versions 10, 12, or greater than 14 of node and you are using 13.12.0.
The solution
To fix this error you need to either upgrade or downgrade your current version of node.
One way to do this is to use NVM (node version manager) to manage multiple versions of node.
To install it with either Linux or Mac you can use either of the following commands
For Wget, run the following command on the terminal:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
For CURL, run the following:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
You will want to change the version number in the commands to the latest stable version.
Once you have downloaded it successfully restart the terminal or you won't be able to find it. If this fails you may need to reset your computer.
If you have NVM installed running the following should show you the current version of it your using.
nvm --version
You can then use the following command to list available versions of node
nvm ls-remote
Select a compatible version and install it like so
nvm install 14.15.0
Running
node -v
Should show this as your current version if not try
nvm use v14.15.0
You should now have no issues running
npx create-react-app tik-tok-clone
It worked for me after running these commands.
sudo npm cache clean -f //clear you npm cache
sudo npm install -g n install n //(this might take a while)
sudo n stable upgrade //to the current stable version

macos: How do I install MiniDC/OS? Error: no module name 'setuptools'

While installing miniDc/OS,I get this error. Is there any other dependency that I need to install, to get rid of this error?
bash-3.2$ brew install https://raw.githubusercontent.com/dcos/dcos-e2e/master/minidcos.rb
Updating Homebrew...
Ignoring path homebrew-cask/
To restore the stashed changes to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask run:
'cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask && git stash pop'
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
binaryen erlang exploitdb fn git-quick-stats goreleaser libcerf minio
######################################################################## 100.0%
==> Downloading https://codeload.github.com/dcos/dcos-e2e/legacy.tar.gz/2018.12.10.0
Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/4f4e8602babc8445ee074a81a6e032ae53050886dd9e12c8529a684dd5e45c8e--dcos-dcos-e2e-2018.12.10.0-0-g3cedccc.tar.gz
Warning: Cannot verify integrity of 4f4e8602babc8445ee074a81a6e032ae53050886dd9e12c8529a684dd5e45c8e--dcos-dcos-e2e-2018.12.10.0-0-g3cedccc.tar.gz
A checksum was not provided for this resource
For your reference the SHA256 is: 20cf5dd26ed99cd9930e47c77d2aff81aa0b0137aeb4128684165b09312a66e5
==> Downloading https://files.pythonhosted.org/packages/4e/8b/75469c270ac544265f0020aa7c4ea925c5284b23e445cf3aa8b99f662690/virtualenv-16.1.0.tar.gz
Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/bda8bcde19a275fd9c84a7ec957593976e90dfd0e461a87f5698f1d2286c0197--virtualenv-16.1.0.tar.gz
==> python3 -c import setuptools... --no-user-cfg install --prefix=/private/tmp/minidcos--homebrew-virtualenv-20181228-35978-r206u1/target --install-scripts=/private/tmp/minidcos--homebrew-virtualenv
Last 15 lines from /Users/admin/Library/Logs/Homebrew/minidcos/01.python3:
-c
import setuptools, tokenize
__file__ = 'setup.py'
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
.replace('\r\n', '\n'), __file__, 'exec'))
--no-user-cfg
install
--prefix=/private/tmp/minidcos--homebrew-virtualenv-20181228-35978-r206u1/target
--install-scripts=/private/tmp/minidcos--homebrew-virtualenv-20181228-35978-r206u1/target/bin
--single-version-externally-managed
--record=installed.txt
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
Do not report this issue to Homebrew/brew or Homebrew/core!
I recreated this issue by running pip3 uninstall setuptools before brew install-ing minidcos.
I removed the error by running brew postinstall python.
I have added this to the minidcos documentation.
MacOS has default python2.x which keeps conflicting with python3.x.
The only solution I could come up is editing ~/.bash_profile as below
alias python2="/usr/bin/python"
alias python="/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"
Once that change was done. I could install minidcos.

pipenv install glob fails

I tried to install glob in my virtual python (version 3.5) environment. This is an error I got. I found similar questions on this channel, but not much of help.
$pipenv install glob
Installing glob…
Collecting glob
Error: An error occurred while installing glob!
Could not find a version that satisfies the requirement glob (from versions: )
No matching distribution found for glob
The issue is that pipenv looks up the version in the url specified in [[source]] in the Pipfile and glob is not in there. However, glob is part of the Standard Library in Python so you do not need to install it via pipenv and you can just call it from your script 'import glob' and it should work.
You are using python 3.X
here are the correct glob versions
for python 2.7
sudo pip install glob2
for python 3.7
sudo pip3 install glob3

/usr/bin/mingw32-cmake: line 84: fg: no job control (Midori cross-compiling error)

I'm trying to compile Midori Web Browser for Windows on Fedora 22. For that purpose I'm following this tutorial.
I installed these dependencies except faenza-icon-theme:
yum install gcc vala intltool
yum install libsoup-devel webkitgtk3-devel sqlite-devel
yum install mingw{32,64}-webkitgtk3 mingw{32,64}-glib-networking mingw{32,64}-gdb mingw{32,64}-gstreamer-plugins-good
yum install faenza-icon-theme p7zip mingw32-nsis greybird-gtk3-theme
Later I installed faenzai-icon-theme via using a third party rpm.
I downloaded source:
bzr branch lp:midori
cd midori
mkdir _mingw32
cd _mingw32
But at this step:
mingw32-cmake .. -DUSE_ZEITGEIST=0 -DUSE_GTK3=1 -DCMAKE_INSTALL_PREFIX=/usr/i686-w64-mingw32/sys-root/mingw -DCMAKE_VERBOSE_MAKEFILE=0
I'm getting an error:
/usr/bin/mingw32-cmake: line 84: fg: no job control
I don't know how to solve this problem and the meaning of this error. I made a research on internet but nothing came up.
FWIW: I had the same error message trying to build a project of mine. It went away after
yum install cmake
Both mingw32-cmake and mingw64-cmake need cmake to function. (Actually, make that dnf install cmake nowadays.)

Resources