On macOS Monterey 12.5, how can I allow Conda to collect package metadata from <https://repo.anaconda.com/pkgs/main/osx-64/current_repodata.json>? - macos

I am on a MacBook M1 Pro, macOS Monterey 12.5, using conda 4.13.0 in zsh(z-shell) to attempt package installations.
(My goal is to install tensorflow-deps from the apple channel of Anaconda, so I can use GPU-accelerated TensorFlow on my M1 Pro. As far as I understand, Conda is the only way to install apple's tensorflow-deps package.)
Problem
Whenever I try to install packages with Anaconda (conda) in the terminal, I get:
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/osx-64/current_repodata.json>
Note that I managed to successfully access this resource with this command:
curl https://repo.anaconda.com/pkgs/main/osx-64/current_repodata.json
So it seems like it's just the Conda tool that is failing.
The issue has been marked as stale in GitHub, and has not been solved.
Similar issues have been addressed before and solved, but since those solutions are not working, I am assuming that my issue is somehow different, and thus I am creating a new question to nuance the discussion.
Attempted solutions
I have tried everything from the discussion of the GitHub issue, and more.
I have to download and convert my root certificate, and then:
export REQUESTS_CA_BUNDLE=/path/to/root/certificate.pem
as outlined here, but that does not fix the issue.
I have tried replacing
~/opt/anaconda3/lib/python3.9/site-packages/certifi/cacert.pem
with the same generated cert, which did not work.
Doing conda update -n base -c defaults conda as suggested in the GitHub issue shows the same CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/osx-arm64/repodata.json> error.
Some users report that using the -k/--insecure flag or configuring Conda to not verify ssl fixes this issue. This is not really a solution in the first place, and also it does not work for me.
Some Windows users report that copying come DLLs around fixes the issue, but I don't know what the equivalent of this would be on Mac, if there is one.

Related

Installing pyodbc and unixodbc on a mac

I've seen Pypyodbc: Can't open lib 'FreeTDS' : file not found") error when trying to connect to SQL server, but. that's 7 years old, and doesn't seem to be working for me, possibly because brew appears to be putting things in different places now?
I've used brew to install unixodbc, it's in /opt/homebrew/Cellar.
When I do pip install pyodbc, it appears to work, but I get:
connection = pyodbc.connect(connection_string)
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libtdsodbc.so' : file not found (0) (SQLDriverConnect)")
which is obviously wrong, because libtdsodbc is in /opt/homebrew/lib
I tried editing odbcinst.ini, but I'm not sure where that's supposed to live. There wasn't one in /etc, or a /etc/unixODBC directory... and when I create either one, the don't seem to be read, because it still complains about /usr/local/lib...
ETA: This is on a new Macbook, so on one of the new M1 chips.
Note: This is a BAD answer in the hopes of attracting a good one, but it technically seems to be working.
Homebrew for M1 installs everything in /opt/homebrew. Everything else expects things in /usr/local. On a new computer, /usr/local/lib didn't even exist. So I did
sudo ln -s /opt/homebrew/lib /usr/local/lib
THIS IS VERY BAD AND I KNOW IT But it's the only way I've figured out currently to deal with the problem. Maybe something hasn't caught up to M1? I'm not sure.
BETTER solution:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/homebrew/lib
There is a pull request that has been pretty much ignored for 13 months now by the pyodbc maintainer: https://github.com/mkleehammer/pyodbc/pull/870
You can install the forked version with this command (might need to uninstall the previous version or add extra arguments to force reinstall)
python3 -m pip install git+git://github.com/Aloisius/pyodbc.git#m1-homebrew

Anaconda Navigator (2.0.4 --> 2.1.1) won't update on Windows 10

I am just wondering if anyone has had the issue stated in the title.
Context
I am currently on anaconda navigator version 2.0.4 (this was a July 2021 release if I am correct), and I am looking to upgrade the navigator to version 2.1.1 (the latest release as of this posting). My OS is Windows 10.
Problem
When I update from the navigator itself (on the "upgrade now" button), the update says it's running but never finishes (I sat about an hour before dismissing it).
I tried manually installing the update, but it just tells me that "all requested packages are already installed" (see below)
I even tried going into anaconda powershell prompt, deactivating conda and updating it, but still the same issue ("all requested packages are already installed"), see below:
I am wondering if anyone has the same issue as I do? Are there any more potential fixes I could try? Preferably one in which I don't have to uninstall and reinstall anaconda. The navigator is important to me because that's where I install all my packages into the various virtual environments. I can work around it if it's unfixable but I'd rather have it working straight. Appreciate the help.
I had a simmilar problem. I was trying to upgrade from version 1.9.12. I tried severeal times with this sequence of commands:
conda update conda
conda update --all
conda deactivate
conda update anaconda-navigator
But it was unsuccesful. anaconda-navigator did not upgrade and there was still an upgrade button in the navigator app, which should upgrade to the latest version, which was 2.1.2 at the time. Clicking
this button was also unsuccesful.
Then i found this https://docs.anaconda.com/anaconda/install/update-version/, how to install a specific version of a package.
I tried this command:
conda install anaconda-navigator=2.1.2
And it worked. The output of the command was suggesting something was wrong with repositories:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done
But it finnished successful. At the end I also did this.
conda update conda
conda update --all
And now a have everything updated to tha latest version, including anaconda-navigator. I hope this somehow helps.
Right click the shortcut of the navigator (or the icon in Start) and choose "Run as administartor".
Once the navigator opens run the upgrade

AllenNLP Torch Version Unavailable

I am trying to install allennlp via pip on the latest version of macOS Catalina. The Python version is 3.9.0. The pip version is 20.2.4.
I was just able to install only a couple of weeks ago, but now I receive the following error when I run the command:
pip3 install allennlp allennlp-models
ERROR: No matching distribution found for torch<1.8.0,>=1.6.0 (from allennlp)
This is really bad because a time-sensitive project I am working on right now completely depends on allennlp working. I needed to reinstall due to some git issues, and my virtual env was reset. What can I do to resolve this issue?
Thanks.
EDIT: Somehow I ended up uninstalling 3.9 in homebrew and now I'm stuck at jsonnet. It errors out. I saw some posts about this issue, but none of the recommendations work.
EDIT2: I tried reinstalling brew's python 3.9. jsonnet standalone works again, but then I have the pytorch issue again.
I'm stuck in a loop. Neither the system macOS 3.8 python nor the latest 3.9 home-brew python works. I'd rather get the home-brew python working, but there's no valid version of torch available for that one apparently.
Do NOT accidentally use home-brew to download the latest Python 3.9. That isn't compatible with a lot of the required libraries.
Phew.

How to Fix Entry Point Not Found while installing libraries in conda environment

I'm working on Anaconda by making multiple environments in it. I have made an environment camelot and now I want to install different libraries in this environment. So for example to install pandas in this environment,
I'm writing:
conda install pandas
or
conda install -c conda-forge camelot-py
Then it gives me this error:
python.exe-Entry Point Not Found
The procedure entry point OPENSSL_sk_new_reserve could not be
located in the dynamic link library.
C:\Users\abc\Anaconda3\Library\bin\libssl11_-x64.dll
First I thought it may be because of the environment variable, thus I set an environment variable for Python, but this did not resolve the issue.
as it is suggested in here I could solve this problem by copying libssl-1_1-x64 dlls in Anaconda/DLLS to Anaconda/Library/bin (probably replacing it)
I got the same issue while updating Anaconda navigator, and got it over by replacing the file libssl-1_1-x64.dll in Anaconda3/Library/bin with the one from Anaconda3/DLLs.
As mentioned by an Anaconda maintainer here ...
moving libssl dlls around like that is really not advisable. Those
DLLs are duplicated because you have something fishy going on in your
packages. There should not be any openssl DLLs in the DLLs folder.
They should be in Library/bin
By looking at the JSON files in the conda-meta directory I found out that DLLs\libssl-1_1-x64.dll was installed by the python 3.7.0 package, and Library\bin\libssl-1_1-x64.dll was installed by the openssl package. After further investigation I found out that Python 3.7.0 does not install OpenSSL as a separate package, but Python 3.7.1 (and later) does.
Typically upgrading Python goes as expected, but if you somehow end up with both python 3.7.0 and openssl packages installed simultaneously there will be two libssl-1_1-x64.dll files and your Anaconda distribution will be broken. (You can easily verify this with the conda list command.)
I think the best way to fix it is therefore:
Rename Library\bin\libssl-1_1-x64.dll to Library\bin\libssl-1_1-x64.dll.org (your are going to need it later.)
Copy DLLs\libssl-1_1-x64.dll to Library\bin\libssl-1_1-x64.dll
Update Python to version 3.7.1 or higher, for instance with conda update python. This will remove the DLLs\libssl-1_1-x64.dll file.
Delete the current Library\bin\libssl-1_1-x64.dll file.
Rename Library\bin\libssl-1_1-x64.dll.org back to Library\bin\libssl-1_1-x64.dll. This is necessary because I got HTTP errors in the next step otherwise.
Reinstall OpenSSL with conda install openssl --force-reinstall to ensure it's up to date again.
I had the exact same issue, and it also just started today. Kind of destroyed my entire work day, tbh...
I accidentally did a conda install ... in my base environment, and it updated conda and a handful of other modules. (Conda went from 4.5.12 to 4.7.10, in my case.) Anyway, after I rolled it back, things are working as expected again.
If this is what's causing your issue, here's a fix.
conda list --revisions
conda install --revision 1 (In my case "rev 1" was my most recent, stable base environment.)
(More details about this: https://sriramjaju.github.io/2018-05-30-2-minute-recipe-how-to-rollback-your-conda-environment/)
Now I'm worried that I've inadvertently configured something in a way that isn't compatible with the newest version of conda.
Edit: Don't follow this last suggestion if you're doing anything other than playing around in a conda environment to test-drive modules. See this and this.
Lastly, if you really need to install modules and do some work ASAP, pip install [module name] was still working for me before I thought to do the reversion thing.
My problem was same. I just uninstalled anaconda, and install it again. And the problem solved.
I was receiving the same following error while updating spyder and conda package.
python.exe-Entry Point Not Found
The procedure entry point OPENSSL_sk_new_reserve could not be
located in the dynamic link library.
C:\Users\abc\Anaconda3\Library\bin\libssl11_-x64.dll
solution:
I did replace libssl-1_1-x64 dlls from Anaconda/DLLs to
Anaconda/Library/bins as suggested here.
Before opening Anaconda Navigator desktop app, I updated conda in Anaconda Prompt using conda update conda. conda successfully updated.
Then I have updated spyder using conda update spyder command in
Anaconda Prompt. spyder updated and running successfully.
For those still having similar issues with libssl11_-x64.dll or other .dll files:
Use pip install instead if you can!
I had the same issue today with libcrypto-1_1-x64.dll when trying to install plotly using
conda install -c plotly plotly
This prompts a downgrade for anaconda, and in turn raises the error:
OPENSSL_sk_new_reserve [...] libcrypto-1_1-x64.dll
Instead, using for example
pip install plotly==4.1.0
works like a charm!

Conda Pytorch on Windows results in HTTP Connection Error

In general, my package manager and connection work fine. I just ran a conda update --all command that worked and updated all of my packages. However, when I run conda install -c pytorch pytorch as specified on anaconda's website https://anaconda.org/pytorch/pytorch it results in the following error.
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/win-64/pytorch-0.4.0-py36_cuda80_cudnn7he774522_1.tar.bz2>
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.
I was curious if anyone else is experiencing this problem, as you may notice the pytorch upload for windows was only made on conda 3 days ago. Otherwise, if someone has a fix that will be compatible with conda, your input is appreciated.
UPDATE [SOLUTION]: I went to work and found an additional conda upload command for pytorch has been recently updated for windows. That is conda install -c soumith pytorch as specified https://anaconda.org/soumith/pytorch
I found this command to work on both my home and work laptops.

Resources