conda / conda

A system-level, binary package and environment manager running on all major operating systems and platforms.
https://docs.conda.io/projects/conda/
Other
6.41k stars 1.66k forks source link

Guidance on syntax for installs from local channel #7600

Closed ranjitiyer closed 2 years ago

ranjitiyer commented 6 years ago

I'm submitting a...

Current Behavior

I'm wanting some guidance on the correct syntax to install a package from a local channel but allow dependencies to be obtained from the 'default' channel.

I have a locally built sparkmagic package (built with conda build)

  1. Index it

    root@95ac4cdd1e1c:/# conda index /tmp/linux-64/
    root@95ac4cdd1e1c:/# ls /tmp/linux-64/
    repodata.json  repodata.json.bz2  sparkmagic-0.12.5-py36h39e3cac_0.tar.bz2
  2. Add local channel

    conda search --platform linux-64 --offline -c file:///tmp --override-channels
    Loading channels: done
    # Name                  Version           Build  Channel
    sparkmagic               0.12.5  py36h39e3cac_0  tmp
    root@95ac4cdd1e1c:/#
  3. List channels and find 'tmp' has precedence

    root@95ac4cdd1e1c:/# conda config --get channels
    --add channels 'defaults'   # lowest priority
    --add channels 'tmp'   # highest priority
    root@95ac4cdd1e1c:/#
  4. Enforce channel priority

    conda config --set channel_priority true
  5. Install sparkmagic. I notice that it won't find sparkmagic in the local channel but tries to install it from 'default'

conda install --dry-run --channel-priority --show-channel-urls --force --use-local sparkmagic

 Package Plan ##

  environment location: /root/miniconda3

  added / updated specs:
    - sparkmagic

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    constantly-15.1.0          |   py36h28b3542_0          13 KB  defaults
    twisted-18.4.0             |   py36h14c3975_0         4.9 MB  defaults
    widgetsnbextension-3.3.0   |           py36_0         1.7 MB  defaults
          . . . 
   sparkmagic-0.12.5          |           py36_0          65 KB  defaults
    numpy-1.15.0               |   py36h1b885b7_0          35 KB  defaults
    jsonschema-2.6.0           |           py36_0          62 KB  defaults

I'm new to this, so guessing there's a missing flag or step.

My objective is to install sparkmagic alone from tmp but have its dependencies obtained from default

Thanks :)

kalefranz commented 6 years ago

Ah. The --use-local flag is equivalent to -c local. There is literally a special channel named local, which is actually the conda-build channel, and therefore sort of a confusing name. Unfortunately, it's historic and difficult to change, so we're stuck with it.

For what you're trying to do, --channel-priority --show-channel-urls --force are all overkill. Channel priority is enabled by default. I didn't even know --show-channel-urls was a valid flag for the install command. The --force we're trying to get away from; it means too many different things in too many different contexts.

For what you're trying to do, I'd recommend just

conda install --dry-run -c file:///tmp sparkmagic

or

conda install --dry-run file:///tmp::sparkmagic
github-actions[bot] commented 2 years ago

Hi there, thank you for your contribution to Conda!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue in the latest version of Conda

  2. Comment that the issue is still reproducible and include:

    • What version of Conda you reproduced the issue on
    • What OS and version you reproduced the issue on
    • What steps you followed to reproduce the issue
  3. It would also be helpful to have the output of the following commands available:

    • conda info
    • conda config --show-sources
    • conda list --show-channel-urls

NOTE: If this issue was closed prematurely, please leave a comment and we will gladly reopen the issue.

In case this issue was originally about a project that is covered by the Anaconda issue tracker (e.g. Anaconda, Miniconda, packages built by Anaconda, Inc. like Anaconda Navigator etc), please reopen the issue there again.

Thanks!

github-actions[bot] commented 2 years ago

Hi again!

This issue has been closed since it has not had recent activity. Please don't hesitate to leave a comment if that was done prematurely.

Thank you for your contribution.