How to update to sklearn 1.1.3 in google colab - installation

I love google colab, but I would like to use sklearn version 1.1.3 because I'm using CCA, which has changed from version 1.0.2 (what colab comes with) and version 1.1.3 (which is the current stable release).
I've tried to do so with
!pip install scikit-learn==1.1.3
import sklearn
sklearn.__version__
But I get the following error message
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
ERROR: Could not find a version that satisfies the requirement scikit-learn==1.1.3 (from versions: 0.9, 0.10, 0.11, 0.12, 0.12.1, 0.13, 0.13.1, 0.14, 0.14.1, 0.15.0b1, 0.15.0b2, 0.15.0, 0.15.1, 0.15.2, 0.16b1, 0.16.0, 0.16.1, 0.17b1, 0.17, 0.17.1, 0.18, 0.18.1, 0.18.2, 0.19b2, 0.19.0, 0.19.1, 0.19.2, 0.20rc1, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.20.4, 0.21rc2, 0.21.0, 0.21.1, 0.21.2, 0.21.3, 0.22rc2.post1, 0.22rc3, 0.22, 0.22.1, 0.22.2, 0.22.2.post1, 0.23.0rc1, 0.23.0, 0.23.1, 0.23.2, 0.24.dev0, 0.24.0rc1, 0.24.0, 0.24.1, 0.24.2, 1.0rc1, 1.0rc2, 1.0, 1.0.1, 1.0.2)
ERROR: No matching distribution found for scikit-learn==1.1.3
1.0.2
It seems like google colab just doesn't have higher than 1.0.2
Does anyone know of a good workaround that good let me use version 1.1.3 of sklearn?

Related

Rails 7 net-protocol and io-wait dependency

I am trying to deploy a webapp in Ruby 3.0.2 and Rails 7.0.1 and I have a problem after deploying it via capistrano in a production server Ubuntu 20.04 with nginx(1.18.0) and passenger(6.0.12).
All the processes work fine but the app can not start in production. I get the passenger error page. Finding in logs I get the next error:
"Error: The application encountered the following error: You have already activated io-wait 0.1.0, but your Gemfile requires io-wait 0.2.1. Since io-wait is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports io-wait as a default gem"
I have tried to remove the gem io-wait but is a default system gem and I cannot remove it, I have upgraded the bundler to the latest (2.3.4) and the error persists. I have added the latest io-wait version (0.2.1) and got the same error.
Any help will be welcome.
I got it to work by adding
gem "io-wait", "0.1.0"
I then also had the problem with "strscan". Had to downgrade to "3.0.0".
I was able to get things going by using the following:
gem "io-wait", "0.2.0"
In my gem file I set the two offending gems to the old versions.
gem "io-wait", "0.1.0"
gem "strscan", "3.0.0"
After that, deploying and booting the app worked fine.
Ruby v3.0.2
Rails 7.0.0

CocoaPods adds a dependency not in Podfile: how to delete it?

I have never add a file named box with podfile. but after pod update, it appearance and when I vim podfile want to delete it, it doesn't exist. How to delete it?
Pods can use other pods. So when you install them it install also inner pods. You can check your pods and see which one using it. Do not delete it.
You can get the list of pods own dependencies in the Podfile.lock file. Open it and you'll see:
- ReactiveCocoa (3.0.0):
- ReactiveCocoa/UI (= 3.0.0)
- Result (~> 0.4.1)
- ReactiveCocoa/Core (3.0.0):
- ReactiveCocoa/no-arc
- Result (~> 0.4.1)
- ReactiveCocoa/no-arc (3.0.0):
- Result (~> 0.4.1)
- ReactiveCocoa/UI (3.0.0):
- ReactiveCocoa/Core
- Result (~> 0.4.1)
- Result (0.4.4):
- Box (~> 1.2)
Which means that ReactiveCocoa (3.0.0) has a dependency on Result (~> 0.4.1), and Result (0.4.4) has a dependency on Box (~> 1.2).
Well, ReactiveCocoa 3.0.0 was in 2015. Nowadays in 2018, ReactiveCocoa is at version 7.1.0 and has a dependency on a newer version of Result which itself doesn't require Box anymore, so a pod update on the same Podfile will remove Box.
It maybe owned by other pods, so don't try ro delete it.

"Could not find activesupport" when 3 versions installed

I'm just trying to use the simple career_builder gem and just get it imported by running the simple script:
require 'career_builder'
puts 'Hello world!'
and yet get the following error: /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:315:in 'to_specs': Could not find 'activesupport' (~> 2.3.5) - did find: [activesupport-4.2.1,activesupport-3.1.12,activesupport-3.0.3] (Gem::LoadError)
I installed the gem with gem install career_builder and ran bundle install and even updated activesupport to the most recent version, but for some reason, the program can't find the newer version of activesupport. Does the gem require version 2.3.5?
http://guides.rubygems.org/patterns/
The ~>or 'twiddle-waka' is a ruby gems shortcut to specify the earliest version of the gem you can use without letting you go up to the next major release.
Your gem is being a bit unorthodox and also specifying a patch level.
So the gem_specification you're working with (activesupport' (~> 2.3.5)) really means minimum version of 2.3.5 maximum of the last patch released before 2.4.0.
The activesupport versions you have installed are all for subsequent major releases and won't work. Install something between 2.3.5 and 2.4.0 and you should be good to go.
Yes. It does require Active Support version >= 2.3.5 and < 2.4.0. All of your Active Support versions are > 2.4.0.
~> is called the spermy operator. See Meaning of tilde-greater-than (~>) in version requirement?
The gem has not been updated in 4 years, so it uses Rails 2.
FWIW, I don't think you'll have much luck getting it to work, so you may want to find a similar gem that works with Rails 4 and has been updated within the last few months.

Trouble with Gem version ahead of what Rubygems expects

I seem to have an issue with the version of a gem that I am using.
I have no internet access, I downloaded the gem straight from the Rubyforge and then SCPed it to the target machine and I used gem install --force --local to install it. Ruby/Rubygems comes from a snapshot of the EPEL repo taken about a month ago. It is hosted on on a machine in the network and YUM is configured across the network to point to the correct location.
I am trying to use the Net::SSH family of gems (Net:SSH, Net::SSH::Shell, Net::SSH::Multi, Net::SSH::Gateway, Net::SCP). When I run my file.rb I get this:
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': RubyGem version error: net-ssh(2.6.6 not ~> 2.1.0) (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:249:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35:in `require'
from ./cluster_config.rb:12
I have seen a lot of issues around the internet about the actual version being less that than the expected version, but I have only found on example where the actual version was newer than the expected, but it was "resolved" with a response from the OP saying "My buddy got it, thanks."
This is also the first time I have seen the ~> operator in this use. Usually I have seen the >= operator here.
Any suggestions?
~> is used inside Gemfiles to allow a gem to be used whose patch version is greater or equal to the specified version, provided that the major and minor versions are identical. For example:
~> 2.1.0 would allow version 2.1.9, but not 2.2.0 or 2.0.0.
~> 2.1.3 would also allow 2.1.9 but not 2.1.0 or 2.2.0.
Also, you could probably download the exact version you need directly from RubyGems. In your case, the link would be http://rubygems.org/downloads/net-ssh-2.1.0.gem .

What does tilde-greater-than (~>) mean in Ruby gem dependencies? [duplicate]

This question already has answers here:
Meaning of tilde-greater-than (~>) in version requirement?
(4 answers)
Closed 8 years ago.
What does ~> mean in the context of Ruby gem depenedencies?
For example, when opening a legacy project in the RubyMine IDE, I get this
message
Gems required for project are not attached:
arel (~> 2.0.2),
rspec-expectation (~> 2.5.0)...
I've seen this tilde-greater-than notation elsewhere in the Ruby world (it's not
specific to RubyMine). Does this operator have a name other than the
awkward-sounding tilde-greater-than?
It means "equal to or greater than in the last digit", so e.g. ~> 2.3 means
"equal to 2.3 or greater than 2.3, but less than 3.0", while ~> 2.3.0 would
mean "equal to 2.3.0 or greater than 2.3.0, but less than 2.4.0".
You can pronounce it as "approximately greater than".
ยง Pessimistic version constraint
it means bring any lower version equal or greater than, but not a major version.
So for example arel (~> 2.0.2), will use (if availble) versions
2.0.2
2.0.3
2.0.? (as long as ? is >= 2)
but it won't use 2.1.?
According to the internet
If a RubyGem dependency uses the syntax "~> 1.4.37", that means "a version greater than or equal to 1.4.37, but not 1.5 or higher." 1
In other words, for you
arel can be 2.1 > version >= 2.0.2 and
rspec-expectation can be 2.6 > version >= 2.5.0.
What this means is that you are expecting a gem that is version 2.0.2 or higher, but not 2.1 in the case of arel (~> 2.0.2) This is done since people are not supposed to release breaking syntax changes in minor revisions. So arel 2.0.3 would be expected to have bug/stability fixes over 2.0.2

Resources