collecting metadata fails if conda is called by absolute path

2 views
Skip to first unread message

Dániel Tüzes

unread,
Jan 10, 2021, 6:02:26 PM1/10/21
to Anaconda - Public
Hi guys,
I have user privileges on my Win10 PC in a corporate environment. I use VS Code and when I try to install a package with it, it fails:
(myenv) PS C:\Users\username> & C:/pathto/conda.exe install pylint
Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://www.corporateurl.com/current_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.

If I try to install it myself by just calling conda, it succeeds:
(myenv) PS C:\Users\username> conda install pylint
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##
...

What is wrong with the first approach used by VS Code?
Kind regards,
Daniel

Ray Donnelly

unread,
Jan 10, 2021, 6:17:58 PM1/10/21
to Anaconda - Public
The thing that is called when you run conda is not an executable. It is a doskey macro or a powershell function or a shell script.

The executable should never be called directly.

--
Community Discussion Forum for Anaconda
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+u...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/anaconda/6a71a067-f222-4f44-bd2c-d83522d38466n%40continuum.io.

Dániel Tüzes

unread,
Jan 11, 2021, 8:58:01 AM1/11/21
to Anaconda - Public, rdon...@anaconda.com
I can assure you that C:/pathto/conda.exe is an executable. I didn't come up with command myself, it is the built-in command for VS Code when one tries to install a python package using conda. Calling it directly can be disputed but it is a design choice in an IDE. (Advantage: when no conda env is active, this can be still called and the IDE does not need to check if an env is active or not.)

Ray Donnelly

unread,
Jan 11, 2021, 9:31:14 AM1/11/21
to Dániel Tüzes, Anaconda - Public
You misunderstand me. Running that exe directly isn't supported and does not work.

Pete Jemian

unread,
Jan 11, 2021, 9:53:38 AM1/11/21
to anac...@continuum.io
Dániel:

It might help if you create a "New Terminal" window inside your running
VS Code instance. Here's what happens for me:

------------------% snip here %------------------
(base)
C:\Users\Pete\Documents\projects\Bluesky\hklpy>C:/Users/Pete/Apps/Anaconda3/Scripts/activate

(base) C:\Users\Pete\Documents\projects\Bluesky\hklpy>conda activate base

(base) C:\Users\Pete\Documents\projects\Bluesky\hklpy>
------------------% snip here %------------------

All these lines were executed by choosing the "New Terminal" item from
the "Terminal" menu. Next, find out what happens when you type "conda"
on the command line in that terminal window. To identify that conda
command, you need to know the full path to it. On windows, the command
to learn this is "where conda" (on bash, it is "which conda"). For me,
in my VS Code editor terminal session on a Win10 workstation:

------------------% snip here %------------------
(base) C:\Users\Pete\Documents\projects\Bluesky\hklpy>where conda
C:\Users\Pete\Apps\Anaconda3\Library\bin\conda.bat
C:\Users\Pete\Apps\Anaconda3\Scripts\conda.exe
C:\Users\Pete\Apps\Anaconda3\condabin\conda.bat
------------------% snip here %------------------

The first item (a batch script) is the default. This is the shell
script that Ray is describing. If your workstation shows similar for
"where conda", then you and Ray now can start talking the same language
about what tools are in use.

Hope this helps,
Pete


On 1/11/2021 8:30 AM, Ray Donnelly wrote:
> You misunderstand me. Running that exe directly isn't supported and does
> not work.
>
> On Mon, 11 Jan 2021, 14:58 Dániel Tüzes, <tuzes...@gmail.com
> <mailto:tuzes...@gmail.com>> wrote:
>
> I can assure you that C:/pathto/conda.exe is an executable. I didn't
> come up with command myself, it is the built-in command for VS Code
> when one tries to install a python package using conda. Calling it
> directly can be disputed but it is a design choice in an IDE.
> (Advantage: when no conda env is active, this can be still called
> and the IDE does not need to check if an env is active or not.)
>
> On Sunday, January 10, 2021 at 11:17:58 PM UTC rdon...@anaconda.com
> <https://groups.google.com/a/continuum.io/d/msgid/anaconda/6a71a067-f222-4f44-bd2c-d83522d38466n%40continuum.io?utm_medium=email&utm_source=footer>.
>
> --
> Community Discussion Forum for Anaconda
> ---
> You received this message because you are subscribed to the Google
> Groups "Anaconda - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to anaconda+u...@continuum.io
> <mailto:anaconda+u...@continuum.io>.
> To view this discussion on the web visit
> https://groups.google.com/a/continuum.io/d/msgid/anaconda/CAF5kcVWe%2BhMkUJ2hB-JPc_UTKx%3D80SUHoHFo_2ah3WqMtjAExg%40mail.gmail.com
> <https://groups.google.com/a/continuum.io/d/msgid/anaconda/CAF5kcVWe%2BhMkUJ2hB-JPc_UTKx%3D80SUHoHFo_2ah3WqMtjAExg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Tüzes Dániel

unread,
Jan 11, 2021, 3:08:04 PM1/11/21
to anac...@continuum.io

Thank you for the clarification!

 

Powershell doesn’t support where nor which, but gcm conda* tells what it will run. As an example, on my pc, it tells:

(base) PS C:\Users\username> gcm conda*

 

CommandType     Name                                               Version    Source

-----------     ----                                               -------    ------

Alias           conda -> Invoke-Conda                              0.0        Conda

Application     conda.bat                                          0.0.0.0    C:\Users\username\miniconda3\Library\bin...

Application     conda.bat                                          0.0.0.0    C:\Users\username\miniconda3\condabin\co...

Application     conda.exe                                          0.0.0.0    C:\Users\username\miniconda3\Scripts\con...

Application     conda_auto_activate.bat                            0.0.0.0    C:\Users\username\miniconda3\condabin\co...

Application     conda_hook.bat                                     0.0.0.0    C:\Users\username\miniconda3\condabin\co...

Application     conda-env.exe                                      0.0.0.0    C:\Users\username\miniconda3\Scripts\con...

 

On my work computer, the first entry is also a conda.bat

But I can ask both conda (run directly with its path or leave it up to the shell) and ask for settings with conda config --show, and they are identical.

 

Kind regards

You received this message because you are subscribed to a topic in the Google Groups "Anaconda - Public" group.

To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/anaconda/cWSBna6TcZQ/unsubscribe.

To unsubscribe from this group and all its topics, send an email to anaconda+u...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/anaconda/b8bd23c9-bd26-0cd2-8fd2-d3782b71be1d%40gmail.com.

 

Reply all
Reply to author
Forward
0 new messages