Closed WolfDSCoder closed 5 years ago
Recently I found that my sitecustomize.py (or sitevendor.py) script (see in previous post) to set CONDA_xxx environment variables is working in general somehow, but in Modules\main.c I did see some minor problems: CondaEcosystemModifyModifyDllSearchPath_Init() can't see variables which I did set in sitevendor.py (or in sitecustomize.py). Can somebody modify Modules\main.c\pymain_main() by moving call to CondaEcosystemModifyModifyDllSearchPath_Init() slightly down, to have it immediately after call to pymain_init() or you can move it to the right place inside pymain_init(). I did change it in my computer and everything works just fine now.
P.S. Your conda_build.bat file can't find Visual Studio 2017 when it is installed in "c:\Progs\VStud". I did find workaround by adding VS140COMNTOOLS=C:\Progs\VStud\Common7\Tools environment variable. After that your conda_build.bat decide that I have some old Visual Studio and conda_build.bat calls to Pyton's PCbuild\build.bat. Python's PCbuild\build.bat properly detects VS2017 and build was completed OK.
P.P.S. I still don't understand one simple thing: why don't make so called "activation" only once inside Python.exe (actually in PythonNN.dll) and no more repeat again and again for each of Anaconda items, as you are doing in PythonHome\Scripts folder and crazy staff in so called "menuinst". I think it is main "disagreement".
P.P.P.S. I think I begin to understand why you don't like "internal activation". You already did implement it inside Modules\Main.c as "#ifdef HARDCODE_CONDA_PATHS" with controlling it from OS environment. Everything done in so strange way, that even you probably don't like how it works (as to me: I don't like it). What about re-imlementing it in smarter way using Python's sys._xoptions and enable all these new "xoptions" from sitevendor.py shipped with Anconda. Instead of hardcoded DLL search path you can properly set it in sitevendor.py into sys._xoptions['xdll_path'] in any way, same way as site.py doing it for sys.path to search Python modules. You can use additional options, if you need (like "xdll_enable", "xdll_mode" and so on). Modification in main.c going to be simple: no more #ifdef HARDCODED, instead of _wgetenv() you are using config_get_options(config, "xdll_option_name"). Implementation of "xdll" options can be merged into Python core (everything is disabled by default), no more crazy "recipe" with patching Python's core source. CondaEcosystemModifyModifyDllSearchPath_Init() should be renamed as pymain_init_xdll() and moved to the end of pymain_init(). In general: CondaEcosystem should be called something like PythonXDLL (I mean code inside Modules\main.c).
We're working to debug this. It's very subtle and involves differences between the base env and any other envs. Here's what we've found:
- Install miniconda (with python 3.7)
conda create someenv_36 python=3.6 conda activate someenv_36 conda install imagesize
You should get the HTTPError here. Sometimes it takes a few seconds to stop working, but when the child env doesn't match the base env, it does break soon after activating the child env, if not immediately.
If you then reactivate the base env:
conda activate conda install imagesize -n someenv_36
This works. In addition, if the child env python version matches the base env:
conda create someenv_37 python=3.7 conda activate someenv_37 conda install imagesize
This also works.
This is a sweet little hack to this bug and it works fine.
I faced the same problem on Mac OS X and with Miniconda. After trying many of the proposed solutions here and on SO for hours I found that I needed to correctly set Condas environment to use the Root certificate that my company provided rather than the generic ones that Conda provides.
Here is how I solved it:
openssl x509 -inform der -in /path/to/your/certificate.cer -out /path/to/converted/certificate.pem
export REQUESTS_CA_BUNDLE=/path/to/converted/certificate.pem
export REQUESTS_CA_BUNDLE=/path/to/converted/certificate.pem
. Now exit your terminal/shell and reopen. Check again.You should be set and Conda should work fine.
I have solved this "CondaHTTPError: HTTP 000 CONNECTION FAILED for url....". For my case it's to do with the company proxy setting.
Detailed error message:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/main/win-64/current_repodata.jsonElapsed: 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.If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team. ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x000001B79FFE3278>, 'Connection to repo.anaconda.com timed out. (connect timeout=9.15)'))"))
Solution:
To configure proxy. This would allow you to install packages.
Notice URL is http (not https) for both http_proxy and https_proxy. The name has https but the url does not.
the "http://proxy-XX:XXX" need to be the route proxy of your company.
All the best!
Solution: To configure proxy. This would allow you to install packages.
Start menu search for “env” Select “Edit Environment Variables for your account” Press “New..” and add two variables “http_proxy” and “https_proxy” both with the same value http://proxy-XX:XXX
Notice URL is http (not https) for both http_proxy and https_proxy. The name has https but the url >does not.
the "http://proxy-XX:XXX" need to be the route proxy of your company.
All the best!
This solved it for me! After trying ALL the other things. I'm on a company network with proxy.
Thanks alot @li-xuesong !! 👍
For folks behind a corporate/university network who are still facing issues with this,
this worked for me :
conda config --set ssl_verify /path/to/certs.pem
OR
conda config --set ssl_verify True
and set REQUESTS_CA_BUNDLE=/path/to/certs.pemI met the same question in signing in to anaconda.org in navigator. And I resolved this by closing my network proxy.
I'm having the same issue as originally posted by @cameronsr in #2648.
I can't create a new environment in Anaconda. It seems the Anaconda API domain setting (currently https://api.anaconda.org) is flagged as an invalid URL.
To try and resolve it, I tried to use " conda install anaconda-clean " from the Anaconda Prompt, but get the same CondaHTTPError shown below.
I also tried uninstalling Anaconda from Win10 Programs and Features, then reinstalling Anaconda from a fresh download. The same issues happened. I can't create an environment. I can't update the preferences for the Anaconda API domain setting.
Not sure what to do next. Thank you for any advice.
.condarc
channels:
conda info:
error message seen:
CondaHTTPError: HTTP None None for url https://repo.continuum.io/pkgs/free/win-64/repodata.json.bz2
Elapsed: None
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.
SSLError(SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",),),)