Can't install a Julia package through a proxy connection - julia

I tried the following command in Julia to install FixedEffectModels, but I'm getting this error:
julia> Pkg.add("FixedEffectModels")
INFO: Initializing package repository /root/.julia/v0.4
INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl
ERROR: failed process: Process(`git clone -q -b metadata-v2 git://github.com/JuliaLang/METADATA.jl METADATA`, ProcessExited(128)) [128]
in anonymous at ./pkg/dir.jl:52
I'm using a proxy connection, is it related?

On Windows 7, it seemed to me the .gitconfig worked. But are you sure it's in the correct user home directory (C:/Users/Username by default) and that it is really .gitconfig and not .gitconfig.txt (like I managed to do on my first attempt)?

Your home is root??
Look at this discussion could be inspiring.
export https_proxy=... and Pkg.setprotocol!("https") could probably help?
I also propose to upgrade julia. Because you are using Ubuntu, you could add this ppa:
sudo add-apt-repository ppa:staticfloat/juliareleases
sudo apt-get update
and you could have julia 0.5.2 (unfortunately it was not updated after 0.6)
But if you trust packages on github then you could probably download julia 0.6.1 too. :)

Thegit config --global url."https://github.com/".insteadOf git://github.com/ solve momentarily but after a server reboot it didn't worked anymore, the best solution found in this discussion was installing Julia 0.6+ because it can use the environment variables, so the export take effects in Julia.

Related

How do I fix the CondaHTTPError [duplicate]

I'd like to install the pymongo library but I'm getting the following error:
(C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
conda install -c anaconda pymongo
Fetching package metadata ...
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/a
naconda/win-64/repodata.json>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', por
t=443): Max retries exceeded with url: /anaconda/win-64/repodata.json (Caused by
ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x000
00000054D6128>, 'Connection to conda.anaconda.org timed out. (connect timeout=9.
15)'))",),)
Steps taken to resolve:
1. Update C:\Users\\xxxxxxx\.condarc file with the following:
channels:
- defaults
ssl_verify: false
proxy_servers:
http: http://sproxy.fg.xxx.com:1000
https: https://sproxy.fg.xxx.com:1000
2. (C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
conda config --set ssl_verify False
Additional Info:
(C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
conda info
Current conda install:
platform : win-64
conda version : 4.3.27
conda is private : False
conda-env version : 4.3.27
conda-build version : 3.0.22
python version : 3.6.2.final.0
requests version : 2.18.4
config file : C:\Users\xxxxxxx\.condarc
netrc file : None
offline mode : False
user-agent : conda/4.3.27 requests/2.18.4 CPython/3.6.2 Windows/7 W
indows/6.1.7601
administrator : False
A number of posts online simply reinstalled Anaconda, any other options apart from a fresh install?
This works a charm:-
Just copy these:-
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
from D:\Anaconda3\Library\bin to D:\Anaconda3\DLLs.
Execute the following command in the cmd prompt/terminal:
conda config --set ssl_verify no
I try to create a virtual env with python 2.7 with anaconda, the base env is python 3.7. I encounter the exactly same problem. It turns out that there isn't such problem with other virtual envs with python 3.7 or 3.6.
This post works perfectly to solve my problem on win7 with anaconda prompt.
It basically says you need to add the following directories into your user environment path in windows (go to Start and type in: View Advanced System Settings, then select Environmental Variables: then select Path and click Edit: finally you can click New and add a path):
C:\your_directory_to_anaconda3\Anaconda3\Scripts
C:\your_directory_to_anaconda3\Anaconda3\
C:\your_directory_to_anaconda3\Anaconda3\Library\bin -- This is the directory for openssl
If you added conda to your PATH variables, remove it and use the "Anaconda Prompt". This solved the problem for me.
See: https://github.com/conda/conda/issues/8046#issuecomment-450582208
I faced this issue when I tried to create environment. I solved it by first activating conda base environment by using:
conda activate base
then I created the environment
conda create -n myenv python=3.7
Check the proxy URL
Verify .condarc file
For me, the problem was with the indentation in the .condarc file.
proxy_servers:
http: http://testproxy:8080
https: https://testproxy:8080
My authenticated proxy server is configured with a domain whitelist for massive and repeated downloads so root or local sudoer doesn't need to be authenticated.
Adding conda.anaconda.org is not enough as this repo redirect its traffic to amazonaws.com.
In my case, adding ".amazonaws.com" to the whitelist solved the issue.
The issue was resolved by adding a username and password to file C:\Users\xxxxx.condarc
channels:
- defaults
ssl_verify: false
proxy_servers:
http: http://xxxxx:password#sproxy.fg.abc.com:yyyy
https: https://xxxxx:password#sproxy.fg.abc.com:yyyy
I had the same problem on Windows 10-64 bit and intuitively installed the 64-bit version of miniconda. However, it results in exactly the same error above. Installing 32 bit conda installer has resolved the issue
Before installing some package (pydicom) the installation run just fine. After
it I tried to install matplotlib, but I got the same error as yours.
I tried conda config --set ssl_verify no but it didn't solve the problem so I set it again to true.
Fortunately, I had a virtual environment where I installed my packages. I closed all Anaconda prompts and tried in a new test environment. Magically, the install worked. I came back to my original virtual env and run the install again, and it worked!.
It might be that I just had to wait for some time before I could use conda install again.
One other thing I could do is remove the package that caused the problem, but I didn't have the chance to try it. If it has anything to do with some virtual environments not being affected, then one possible way to guard against this is to clone the environment before installing any new package.
Edit: I tried the same solution but It did not work. But instead of showing the error immediately, it asks me whether I want to proceed. I deactivated the env, and re-opened anaconda prompt, then did the same steps as above and worked again.
I also had the Same Issue, I resolved by installing 32 bit Anaconda Installer.
Which resolved the CondaHTTPError: HTTP 000 CONNECTION, on Windows 64 bit.
I faced this issues after "conda clean -a" on win-64.
Activating and deactivating existing conda env resolved the issue.
You might need to upgrade your openssl installation
You can download it here (Try the latest version):
https://slproweb.com/products/Win32OpenSSL.html
Source:
https://github.com/ContinuumIO/anaconda-issues/issues/6424#issuecomment-464660808
My issue was simply not running the conda init command prior to attempting to create an environment.
Came across the CondaHTTP Connection error after installing Anaconda environment on a new Windows 10 computer. I tried virtually all the recommendations above unsuccessfully! Looking up the Anaconda archives ( https://repo.continuum.io/archive/ ), I downloaded the immediate previous release .... and on installation and rebooting my PC, all is now wellscreenshot of release
In short - installing Microsoft Visual C++ Redistributable for Visual Studio solved my problem.
In more detail: upon trying a suggested solution of installing a new version of OpenSSL, the installation process told me I was missing a dependency - the Visual Studio Redistributable package. The installer led me to a direct download page of the 2017 version. I can't find that page now, but the official release of 2019 can be found here, and should work as well (found under Other Tools and Frameworks).
Uninstalling and reinstalling anaconda for all users (instead, of current user only, requires admin privileges) and activating the option to add Anaconda to PATH during the installation process, fixed the issues for me.
Thank you everyone for your responses. In my case, I found out that my Kaspersky Internet Security was blocking it the whole time. The moment I quit the application all applications were downloaded. Please check your firewall settings before trying all the above options.
I tried all of these solutions and none worked for me. After running the command
conda config --remove-key channels
in the Anaconda Prompt, everything started working for me on my next attempt.
Adding that I had the same problem on ubuntu on WSL. None of the solutions worked for me, until I realized I was working on WSL version 1 (I thought I'd already upgraded). Upgrading from WSL 1 to WSL 2 solved the problem for me.
Running following these two commands worked for me.
conda config --remove-key proxy_servers
conda clean --source-cache
I'd tried all of the advice on this and many other webpages.
In the end I broadcast a "help me Obiwan Kenobi, you're my only hope message" to a large group of people at work and one of them who used python all the time was able to help me
The trick was to set several windows environmental variables
CURL_CA_BUNDLE
REQUESTS_CA_BUNDLE
SSL_CERT_FILE
To my company's root certificate (a .cer or .crt) which I had downloaded to a spot on my disk
You may also need to add (in my case)
C:\Users\kdalbey\Anaconda3\Scripts
(or your particular \Anaconda3\Scripts) to your path.
And then I set proxies just for good measure
note I previously copied libcrypto-1_1-x64.dll, libcrypto-1_1-x64.pdb, libssl-1_1-x64.dll, libssl-1_1-x64.pdb from anaconda3\Library\bin to anaconda3\DLLs so that could be part of the secret sauce
and it didn't work until I killed and restarted anaconda-navigator
Two steps to deal with this error.
The Anaconda prompt configures the path, to include all the necessary executable files (for instance Library\bin - On Windows, launch it with admin permission). So that you need to use it to execute conda :
Update conda with conda update conda
Exit my proxy software which solved the issue.
I would like summarize some of the proposed answers in this post and propose my experience on that. As it can be understood from the error explanation, the error is related to the connection and I strongly believe that no need to uninstall and reinstall anything if the real cause of the problem be known. My problem gone away after the system powered off and powered on again one day later. So, some possible causes and their solutions (these solutions could be tested in order based on the written bulleted order) could be as follows:
Crash in anaconda prompt:
Probable solutions:
Deactivating and activating the environment, without removing all packages or …, or
Closing/reopening the prompt (Michael Heidelberg) or
Using cmd.exe instead, perhaps
Non-responsiveness of the anaconda site:
Massive site traffics related probable issues, that could be the reason of non-responsiveness or to temporary block some IPs
Probable solutions:
Retying as recommended in the error: HTTP errors are often intermittent, and a simple retry will get you on your way. It solves my problem sometimes. or
Activate or deactivate VPNs or Proxies (like use in .condarc; see: Github sroder, Nandhan Thiravia, Vinod Sangale, Peter Lucas, Sunding Wei).
Try after a while if you have time
System firewall block the site:
That might be happened by activating and deactivating of VPNs, repeatedly or by some other works
Probable solutions:
Finding the issue in system firewall and allowing the connection in the firewall settings (ScienceJedi, Github)
Reboot, perhaps
If the aforementioned ways didn't solve the problem, testing the related answers in the following order:
Add ...\Anaconda3\Scripts, ...\Anaconda3\, and ...\Anaconda3\Library\bin to the path (talentcat, skerjj, Victor Ochieng, jankap), perhaps need a reboot after (lightarrow)
Copying libcrypto-1_1-x64.dll and libssl-1_1-x64.dll from D:\Anaconda3\Library\bin into D:\Anaconda3\DLLs (Swapnil)
I think it could be used in the first step because It is unlikely to be cause of any other problem. The reason I didn't mention this at the beginning is that the developers could placed these files in that directory during installation, too, in default, but they didn't; perhaps it had some reasons (Github).
Note: these files are for Python >3, and I didn't find them for Python 2. Perhaps they have another names.
It must be said that my problem didn't solve by this solution.
Keep your SSL stack up-to-date (kamal dua, Anaconda troubleshooting, update openssl, Abdulrahman Bres, Update to openssl 1.1.1)
I didn't recommend it at first because Its not a good idea to unset ssl verification unless you know what you are doing (Pratyush comment) and somewhere I read that it couldn't return to True again.
It must be said that my problem didn't solve by this solution, too.
conda config --set ssl_verify false
conda update openssl ca-certificates certifi

How to change the post-installation script of a package and re-install it?

I am trying to install gnocchi-api, gnocchi-metricd and python-gnocchiclient with apt-get. I found that the postinst scripts in /var/lib/dpkg/info have some misconfigured ports due to which I cannot install the packages successfully. I wanted to ask if there is a way to change the post-installation scripts nad then re-install the package.
Thanks.
Ideally this kind of problems would be solved by filing a bug report (possibly with a patch) and letting the maintainer upload a fixed version that you can upgrade to.
If you need an immediate local workaround though, you could do the following:
Either apt download <package> or dpkg-repack <package> if for example this is a local package only, or the archive does not contain the version you are interested in f.ex.
dpkg-deb -R <package_version_arch>.deb bin-dir
sensible-editor bin-dir/DEBIAN/postinst
sensible-editor bin-dir/DEBIAN/control ideally to bump the version to mark this as a local modification, say by appending +local1 or similar.
dpkg-deb -b bin-dir .
dpkg -i <package_local-version_arch>.deb

Error installing JQ on windows

I have been trying to install jq using chocoletey
However, when I run the following command, it fails.
choco install jq
Reading the log file, I see that it is pointing the Powershell script is pointing at a ULR that doesn't exist any more
Attempt to get headers for
http://stedolan.github.io/jq/download/win64/jq.exe failed.
I tried update the powershell script but choco install still not working for me. Can anyone help me out please.
Resolved it after reading details from the following pull-request.
https://github.com/stedolan/jq/issues/959
The solution is to pass -version 1.5 to the install command. The following works just fine.
choco install jq --force -version 1.5
During the moderation process, even if there is a newer version of the application hosted on chocolatey.org, doing choco install <package name> will only give you the latest moderated package.
However, if you are willing to accept the potential for a problematic package, you can always force the installation of an unmoderated package by specifying the version number in the install command, as you have done.
In this case, the unmoderated package actually fixed an issue with the moderated one, so it was safe to proceed with, but just take care when doing this, and only do it on a case by case basis, in the knowledge that an unmoderated package may actually change, based on comments which are raised during the moderation process.

Unable to download .deb in private apt repo

I am trying to setup a private apt repo using this. Have followed the instructions closely. After setting up everything sudo apt-get update works fine (I see Packages file being fetched from apt-repo) but when I try to install a package it fails(I downloaded .deb of haproxy using sudo apt-get -d install haproxy.
Err http://ec2-54-220-154-205.eu-west-1.compute.amazonaws.com/packages/ ./ haproxy 1.4.24-1
404 Not Found
Failed to fetch http://ec2-54-220-154-205.eu-west1.compute.amazonaws.com/packages//home/ubuntu/packages//h/haproxy_1.4.24-1_amd64.deb 404 Not Found
As you can see the URL to the deb package is incorrect.
This path (/home/ubuntu/packages//h/haproxy_1.4.24-1_amd64.deb) is read from Packages file which is generate by dpkg-scanpackages
dpkg-scanpackages ~/private /dev/null | gzip -9c > ~/private/Packages.gz.
(I am not 100% sure if it is a dpkg-scanpackages issue or a nginx config issue, my experience with nginx is not a whole lot).
Any help in trying to fix this would be great.
Thanks
Well in case some one else get stuck on something similar:
I got it working, issue was that I was running dpkg-scanpackages from /home/ubuntu and hence the whole path was being added to the deb package in Packages.gz. I executed the same command from the packages dir and I am able to successfully download the pkgs.
Check out OpenRepo: https://github.com/openkilt/openrepo
This is a package hosting server that can make packages available for both Debian (APT) and Red Hat (RPM) files.

installing R packages on ubuntu 8.10

preface: i'm an os x user coming to linux, so excuse my ignorance in advance
I've installed R using synaptic and now i'm trying to install packages.
I open R then try
install.packages("some_package")
system tries to default to /site-library, then tells me it's not writable, then asks about making a personal library?
Should I just make site-library writable? Or is there something more to this?
The directory /usr/share/local/lib/R is the default location; the directory is has ownership root:staff by default. If you add yourself to group staff (easiest: by editing /etc/group and /etc/gshadow) you can write there and you do not need sudo powers for the installation of packages. That is what I do.
Alternatively, do apt-get install littler and copy the example file /usr/share/doc/littler/examples/install.r to /usr/local/bin and chmod 755 it. The you can just do sudo install.r lattice ggplot2 to take two popular examples.
BTW Ubuntu 8.1 does not exist as a version. Maybe you meant 8.10? Consider upgrading to 9.10 ...
Edit: Also have a look at this recent SO question.
I faced the same issue. The most convenient way is to start R as super user.
sudo R
After that, install.packages("some package") should work.
If you are the only user who needs those packages, then the easiest and neatest way is to let R create a personal library for you. That way you don't need to mess with the system directories managed by the package management system.
Another way to install some packages in Ubuntu is to look for Ubuntu packages with names like r-cran-*. This way you do not have to worry about dependencies, the packages become available to all users, and updates are taken care of by the Ubuntu package management system. But only a small proportion of CRAN packages are available this way and you may not get the latest version.
Well, I prefer to install packages into local R folder ~/R/, but it's just a matter of an individual preference... you can also grant yourself a write permission to default library, it doesn't make any difference.
Be sure to add up-to-date packages. Those packages available in default repos are quite old. R v.2.9.0 is available by default in 9.10, while v.2.10.1 is now available.
So stay up-to-date, add this line to file /etc/apt/sources.list (replace <text> with CRAN server address, you can find server addresses on www.r-project.org > CRAN > Linux > Ubuntu):
deb http://<my.favorite.cran.mirror>/bin/linux/ubuntu karmic/
then run this line in terminal:
gpg --keyserver subkeys.pgp.net --recv-key E2A11821 && gpg -a --export E2A11821 | sudo apt-key add -
and if keys are imported properly, run:
sudo apt-get install r-base-core
or if you already installed R, run:
sudo apt-get update && sudo apt-get upgrade
you should also check for alias functions (try man alias in terminal) to automatize repetitive tasks... feel comfortable in terminal, Synaptic is indeed a good tool, but most Linux users prefer command-line approach for a good reason - it's highly customizable =)
I recommend that you stick with one server (be advised when choosing the default server - I prefer UCLA's server, Berkeley works just fine, Main server is usually busy as hell... so there...)
Alternatively, you can add default CRAN server to .First() function:
# replace '<server address>'
.First() <- function() {
options("repos" = c(CRAN = "<my.favorite.cran.mirror>"))
}
now you can just type:
> install.packages('<somepackage>')
and you'll lose the boring Tcl/Tk serverlist window! Oh, what a relief!
Welcome to Ubuntu!
Cheers, mate!

Resources