Not able to update the spyder-kernel - spyder

It says
Your Python environment or installation doesn't have the spyder‑kernels module or the right version of it installed (>= 2.0.1 and < 2.1.0). Without this module is not possible for Spyder to create a console for you.
You can install it by running it in a system terminal:
conda install spyder‑kernels=2.0
or
pip install spyder‑kernels==2.0.*
Then I get this error: https://trialblogme1234.blogspot.com/2021/06/not-able-to-update-spyder-kernel.html, and nothing works.

You could try the installation again but requesting a more specific version of spyder-kernels (something like conda install spyder-kernels=2.0.1.
If the error regarding conflicts persist you could try to create a new environment and install the latest spyder release available (which in turn will install the correct spyder-kernels version). Using the conda-forge channel, you could create a new environment running something like this from the Anaconda Prompt:
conda create -n spyder-cf -c conda-forge spyder
Then to run the spyder installed in that environment:
conda activate spyder-cf
spyder

This didn't work for me. Running Spyder gives the output:
Your Python environment or installation doesn't have the matplotlib module installed or it occurred a problem importing it. Due to that, it is not possible for Spyder to create this special console for you.
Spyder is now in the spyder-cf environment.
So ran "conda install matplotlib" in that environment.
Spyder is now working (for now).

Related

RubyMine's run config results in error that "Yarn requires Node.js 4.0" on Ubuntu

On my Elementary OS machine (an Ubuntu-based OS), after creating a new Ruby on Rails project with rails new yarntest and loading it in RubyMine, I could not launch it with RubyMine's "Development: yarntest" run configuration. The output was:
=> Booting Puma
=> Rails 6.0.1 application starting in development
=> Run `rails server --help` for more startup options
Yarn requires Node.js 4.0 or higher to be installed.
========================================
Your Yarn packages are out of date!
Please run `yarn install --check-files` to update.
========================================
To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).
However, running rails server in the console worked.
I tried reinstalling Yarn, but it still did not work.
I could only disable the Yarn integrity check in the Ruby on Rails config as stated in the error message (deleting the yarn.lock also appeared to work, but is surely wrong). Similarly, I did not want to track down and remove the different Yarn version, as suggested on another question, since the issue was with RubyMine.
I came across an answer on another question that mentioned this error message when running sudo yarn install (i. e. in sudo mode). I tried running sudo yarn install and could finally reproduce the error message outside of RubyMine's run config. Apparently, when running in sudo mode, the yarn binary was outdated.
The solution is therefore to point RubyMine to the correct yarn binary.
The easiest way to do that is to launch RubyMine from the terminal with rubymine, as pointed out by Olivia. See the related JetBrains ticket.

OpenCV 3.2 Installed but unable to use it. load version 4.0 everytime

I have problem that it's struggling me. I use python (anaconda) for some codes. I'm currently doing the tutorials from openCV.
I create envs everytime I need to install new packages. These are the steps that I am doing:
create a new environment
conda install -c menpo opencv3=3.2.0
conda list
(make sure the version 3.2.0 is installed)
then I go to python to check the version:
python
import cv2
cv2.__version__
'4.0.0'
The problem is that everytime I tried to check if I'm using the 3.2 version. The 4.0.0 version shows up. btw the version 3.2.0 is installed since conda list shows it and it does not even shows the 4.0.0 version.
anyone has an idea why does this happens?
Thank you
It is suggested to create a conda environment and do the installation in tha activated environment. So there will not be conflict between packages. This worked fine for me.
Please try the below steps.
1) To create the conda environment:
conda create -n <env_name> python=3.4 -y
Here env_name can be any name given for the conda environment.
Eg:
conda create -n opencv_test python=3.4 -y
2) Activate the environment:
source activate <env_name>
Eg:
source activate opencv_test
3) Then you can proceed the opencv installation in this activated environment.
conda install -c menpo opencv3
Then try importing. Hope this helps.

(React on Rails) The engine "node" is incompatible with this module. Expected version "..."

For those familiar with the react-on-rails gem, or more generally, yarn:
Just today I updated my Node version to 8.8.1 via Homebrew. Now, when I attempt to run bundle && yarn && foreman start -f Procfile.dev (or just yarn install), I get the following message:
error react-webpack-rails-tutorial#0.0.1: The engine "node" is
incompatible with this module. Expected version "5.10.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation
about this command.
This is likely a very simple issue I am running into, but I have been unable to fix it after a few hours of debugging.
I tried manually updating my Node version in package.json to be that on my computer (did not seem to take effect whatsoever), downgrading my version to 5.10.0 via Homebrew (but was unable to), and even upgrading to the latest version of the gem which meant installing webpack as well.
No matter what I did, my local server startup (bundle && yarn && foreman start -f Procfile.dev) still lead to the same error above. Any ideas for this poor soul?
For anyone running into this same issue, I have not found a solution for the underlying issue but I have found a temporary workaround.
Simply run
bundle && yarn --ignore-engines && foreman start -f Procfile.dev
instead of
bundle && yarn && foreman start -f Procfile.dev
I hope this helps someone else that may have found themselves stuck in the same situation!
You need to update your Node.js version. Try to
Clear NPM's cache:
sudo npm cache clean -f
Install a little helper called 'n'
sudo npm install -g n
Install latest stable Node.js version
sudo n stable
I give you this list of checks to do from the react-webpack-rails-tutorial github page
Basic Demo Setup
Be sure that you have Node installed! We suggest nvm, with node version v6.0 or above. See this article Updating and using nvm.
git clone git#github.com:shakacode/react-webpack-rails-tutorial.git
cd react-webpack-rails-tutorial
Check that you have Ruby 2.3.0 or greater
Check that you're using the right version of node. Run nvm list to check. Use 5.5 or greater.
Check that you have Postgres installed. Run which postgres to check.
Use 9.4 or greater.
Check that you have qmake installed. Run which qmake to check. If
missing, follow these instructions: Installing Qt and compiling
capybara-webkit
Check that you have Redis installed. Run which redis-server to
check. If missing, install with Homebrew (brew install redis) or
follow these instructions.
bundle install
brew install yarn
yarn
rake db:setup
foreman start -f Procfile.hot
Open a browser tab to http://localhost:3000 for the Rails app
example with HOT RELOADING
Try Hot Reloading steps below!
foreman start -f Procfile.static
Open a browser tab to http://localhost:3000 for the Rails app
example.
When you make changes, you have to refresh the browser page.

Error setting up the tesseract OCR in gem in rails

I'm trying to setup the tesseract-ocr gem in my rails environment. I have ran brew install tesseract and then ran a bundle install on the app and that all runs without errors however when starting the app (rails s) the following error is throw:
/Users/xxxx/.rvm/gems/ruby-1.9.2-p290#xxxx/gems/ffi-inline-0.0.4.3/lib/ffi/inline/compilers/gcc.rb:35:in `compile': compile error: see logs at /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.log (CompilationError)
It reference the following log file:
g++ -dynamic -bundle -fPIC -L/usr/local/Cellar/tesseract/3.02.02/lib -I/usr/local/Cellar/tesseract/3.02.02/include -o /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.dylib /var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.cpp -llept 2>>/var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.log
/var/folders/66/pm_j0lp94gvcj0qnlcnsx9pw0000gn/T/.ffi-inline-501/4239dac38f2a721e0dc5b3750d71ce2e6fa4acb6.cpp:1:10: fatal error: 'leptonica/allheaders.h' file not found
#include <leptonica/allheaders.h>
I followed these two issues:
https://github.com/meh/ruby-tesseract-ocr/issues/3 and https://github.com/meh/ruby-tesseract-ocr/issues/21
It talks about setting ENV vars which i have done. I created a test.rb file in the initalizers folder with the following vars set:
ENV['CFLAGS'] = '-I/usr/local/Cellar/tesseract/3.02.02/include'
ENV['LDFLAGS'] = '-L/usr/local/Cellar/tesseract/3.02.02/lib'
However this makes no difference to the error when starting the app.
I don't understand what it means when it says update the headers. I was wondering if someone could tell me exactly what to do to get this working.
Thanks.
Also had the same error. I solved it by installing the dev packages for tesseract and leptonica.
For debian based systems
sudo apt-get install libleptonica-dev libtesseract-dev
For redhat base systems
sudo yum insall leptonica-devel tesseract-devel
That solved the problem for me.
I've fixed this...
Just in case anyone else has a problem here's exactly how it was fixed in mine:
Firstly had to run both:
brew install tesseract
and
brew install leptonica
Then in the Gemfile NOT in an initializer you have to put both paths to the libraries as env vars:
ENV['CFLAGS'] = '-I/usr/local/Cellar/tesseract/3.02.02/include -I/usr/local/Cellar/leptonica/1.69/include'
ENV['LDFLAGS'] = '-L/usr/local/Cellar/tesseract/3.02.02/lib -L/usr/local/Cellar/leptonica/1.69/lib'
Had this issue (OS X El Capitan). Fixed by downgrading tesseract with
brew uninstall --force tesseract
brew install https://raw.githubusercontent.com/Homebrew/homebrew/8ba134eda537d2cee7daa7ebdd9f728389d9c53e/Library/Formula/tesseract.rb
and updating xcode
xcode-select --install

"The program 'ruby' is currently not installed" error after reboot

After the reboot which was required to update all the packages,
ruby -v
doesn't work. It says rails is not installed either, but I guess it should be the similar issue. when I do:
sudo apt-get install ruby
It says the newest version is already installed.
When I do:
dpkg -L ruby
I get the following output:
/.
/usr
/usr/bin
/usr/share
/usr/share/doc
[and other stuff..]
But I realized $PATH already includes /usr/bin:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
:/sbin:/bin:/usr/games:/home/ubuntu/.rvm/bin
May I know why I'm still getting the following error message?:
The program 'ruby' is currently not installed. You can install it by typing:
sudo apt-get install ruby
My .bashrc already has this too:
PATH=$PATH:$HOME/.rvm/bin
dpkg will be checking in a database that it maintains, whereas trying to execute ruby uses the PATH. If I recall correctly, Ubuntu has a bash handler configured to execute when any command is unresolvable; it seems that it just displays that generic message rather than checking with dpkg first.
It is possible that ruby has disappeared from your filesystem (or at least the directory it previously resided in), or that your PATH was changed.
What do you get if you execute "which ruby" and "where ruby"?
Lastly, Ubuntu can complain that a program cannot be found when it is present. This occurs when running a 64-bit version of Ubuntu, without the necessary x86 libraries installed, and trying to execute a 32-bit binary. However, I recall the error message being more along the lines of "file not found".

Resources