Error: curl_easy_setopt: 48 # Downloads.Curl - julia

I am downloading Flux.jl through the REPL in VS Code in a newly created environment. When I added the package via the package manager, I got a a bunch of errors as shown below:
┌ Error: curl_easy_setopt: 48
└ # Downloads.Curl /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Downloads/src/Curl/utils.jl:36
┌ Error: curl_easy_setopt: 48
└ # Downloads.Curl /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Downloads/src/Curl/utils.jl:36
└ # Downloads.Curl /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Downloads/src/Curl/utils.jl:36
This happened probably 100 times but it still seems like the package installed correctly. Is there anything further I need to do here?

See https://github.com/JuliaLang/Downloads.jl/issues/149. The fix will be included in the upcoming Julia 1.6.4 and Julia 1.7.0 releases.
(The error is caused by a change in macOS Monterey, which resulted in Julia finding and loading the wrong dynamic libraries.)
This happened probably 100 times but it still seems like the package
installed correctly. Is there anything further I need to do here?
Probably not; Julia package manager falls back to installing packages from git if https download fails.

Related

How to install a Julia package if it fails to install / build on an M1 Mac?

I am trying to use the Twitter.jl package locally on my M1 Mac. However, when I try to install it, I get:
ERROR: Error building `DecFP`:
┌ Warning: Platform `arm64-apple-darwin21.2.0` is not an officially supported platform
└ # BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:450
ERROR: LoadError: KeyError: key "unknown" not found
DecFP looks like it's an up to date Julia package so I am not sure what the issue would be in this case.
I would like to get a general set of steps to resolve issues like this since I know this package isn't the only one that will have installation issues so hopefully this can be used to help others who have similar issues.
The issue is that Twitter.jl is pulling an old version of OAuth.jl which doesn't work on the M1. I have opened a PR so it pulls a newer version and it should work.
About these cases in general the steps are identifying what package is using BinaryProvider, in this case it's an old MbedTLS that was pulled by an old OAuth. The solutions are, if there is a newer version, change the compat bounds, and if there isn't then one has to build the needed binary using BinaryBuilder.jl and change the dependent packages to use it.
In most cases just opening an issue in github should be enough :).

Cannot install any package in Julia

I had used Julia some months back for a project, and didn't use it since. I hadn't faced problems back then. But now, I absolutely am not able to install any package.
(#v1.5) pkg> add Distributions
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Distributions [31c24e10]:
Distributions [31c24e10] log:
├─Distributions [31c24e10] has no known versions!
└─restricted to versions * by an explicit requirement — no versions left
Any package I install, I am getting the same error. How do I fix it?
This is the status of Pkg:
(#v1.5) pkg> status
Status `C:\Users\jaine\.julia\environments\v1.5\Project.toml`
[6e4b80f9] BenchmarkTools v0.5.0
[7073ff75] IJulia v1.21.2
[91a5bcdd] Plots v1.6.0
[438e738f] PyCall v1.91.4
[d330b81b] PyPlot v2.9.0
[2913bbd2] StatsBase v0.33.0
Given
├─Distributions [31c24e10] has no known versions!
it looks like you have a missing or corrupt package registry. The package manager will reinstall it for you if you delete .julia/registries and try to add the package again.
You can do this from within julia
rm(joinpath(homedir(), ".julia", "registries"), recursive=true, force=true)
These are indeed some of the more tricky situations to resolve so please bear with me as we work through this.
If you are not familiar with the basics of the package manager, it's worth a quick read to check out: https://julialang.github.io/Pkg.jl/v1/getting-started/
Assuming you are now in the Julia Repl, my general work flow for these issues is to remove everything it warns me about. The core problem here is that one of your existing packages is saying it needs a specific version of Distributions.jl but it's not able to add it. So, the first step would be to enter the pkg manager by doing ] and type rm Distributions.
Then, while still in the pkg mode, do resolve and add Distributions.
So the process is to just remove each package the Repl complains about until it stops complaining.
Note: If you run into something like this again, the worst-case scenario is to remove the project and manifest files for the specific Julia version you are using. If you navigate to ".julia/environments" you should be able to completely reset the Julia Env for a specific version there (that way you don't need to actually reinstall Julia).

Trying to add IJulia via the REPL: Unsatisfiable requirements detected for package

I keep trying to add IJulia in the REPL, and I keep getting this error message:
I tried installing JSON directly, but the REPL would say "The following packages names could not be resolved".
If it helps, I'm running a Windows 10 laptop with julia 1.0.5
Is there a fix to this? Should I install an earlier version to julia?
Appreciate the time.
It seems like you have outdated registries locally.
The registries are ~/.julia/registries, message like The following package names could not be resolved usually suggests that registry are not updated or somehow corrupted.
Delete them (the directory ~/.julia/registries/General) and then adding packages should cause the General registry to be downloaded, the newest version. Then you should be able to add IJulia without problem.
More people encountered this problem with messed up registry, see https://discourse.julialang.org/t/registry-failed-to-update/17840/10

How to get geoR and sp R packages working in AWS Linux EC2 AMI

My end goal is to be able to use the geoR and sp packages in R on an AWS EC2 Linux instance. The first hurdle is getting an older version of R since 3.3 doesn't support TCL/TK (at least that I've found).
After unpacking R-3.2.5.tar.gz and following the instructions in the INSTALL file (along with these configure options), a search in the config.log shows the following for TCL and TK:
configure:32908: checking for tclConfig.sh
configure:32950: checking for tclConfig.sh in library (sub)directories
configure:33143: checking for tcl.h
conftest.c:228:17: fatal error: tcl.h: No such file or directory
#include <tcl.h>
config.status:1893: creating src/library/tcltk/DESCRIPTION
config.status:1893: creating src/library/tcltk/Makefile
config.status:1893: creating src/library/tcltk/src/Makefile
ac_cv_env_TCLTK_CPPFLAGS_set=
ac_cv_env_TCLTK_CPPFLAGS_value=
ac_cv_env_TCLTK_LIBS_set=
ac_cv_env_TCLTK_LIBS_value=
r_cv_header_tcl_h=no
TCLTK_CPPFLAGS=''
TCLTK_LIBS=''
TCL_CONFIG=''
use_tcltk='no'
R installs successfully, but running capabilities("tcltk") confirms that something went wrong, as it returns FALSE.
Following the hints here, I searched for tclConfig.sh and tkConfig.sh, and realized I hadn't installed the appropriate dependencies, namely tcl-devel, and tk-devel.
Running yum list available shows a package for tcl-devel.x86_64 but nothing for tk. I downloaded source files for TCL and TK from here, but couldn't find source files for any devel packages.
So now I'm at a loss on how to proceed. Has anyone been through this process that can shed some light on it?
UPDATE
After reading the comment below, I'm afraid I didn't do my due diligence in researching TCL/TK and R 3.3.
My very early efforts to troubleshoot the whole problem consisted of the following workflow- First, without even considering an older version of R, I ran install.packages("geoR") in 3.3.2. This resulted in installation of package 'geoR' had non-zero exit status, along with:
Error: package 'tcltk' does not have a namespace
ERROR: lazy loading failed for package 'geoR'
So, naturally, I ran install.packages("tcltk") which resulted in package 'tcltk' is not available (for R version 3.3.2)
As I mentioned before, this was very early on. I took the message literally and didn't think to look further into TCL/TK for 3.3, but instead started looking to get an earlier version of R, since I had been successfully running geoR and sp on another system that had R 3.2.5.

enableJIT in Rprofile leads to 'not a proper evaluation environment' on startup

I have had
library(compiler)
compiler::enableJIT(3)
in ~/.Rprofile for years; now that I upgraded to 3.2.1 I get this on startup:
Error in frameTypes(env) : not a proper evaluation environment
Calls: <Anonymous> -> <Anonymous> -> makeCenv -> structure -> frameTypes
> q()
Warning message:
restarting interrupted promise evaluation
I don't see anything relevant in NEWS.
Replacing 3 with 2 in compiler::enableJIT(3) removes the error.
However, I would prefer my loops to be compiled too.
Suggestions?
PS. I observe the same behavior on MacOSX 10.10.4 (R downloaded from cran) and CentOS 6.6 (R installed using yum).
It's a subtle "thinko" (confusing the base namespace environment with the base environment) in the new fast topenv() function which made it into the source code of R in January ... it would really have been great if you had upgraded sooner..... or even tried "R-devel" so this buglet would never have seen the light of day in a released version of R.
Please, please, all ye readers : Do help open source projects such as R by at least using the very latest released versions, .. even better, do occasionally run everyting with "R-devel" --- the development version of R, available via svn, git and most conveniently for installation from the daily snapshot tarballs at http://stat.ethz.ch/R/daily/

Resources