Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda env export lists conda packges with "_" (underscore) twice, as conda and as pip #4445

Closed
vroetman opened this issue Jan 27, 2017 · 5 comments
Labels
good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward locked [bot] locked due to inactivity source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type

Comments

@vroetman
Copy link

vroetman commented Jan 27, 2017

This is seen with conda 4.3.8
conda env export will list packages with an underscore in their name twice, once as a conda dependency, and once as a pip dependency with the underscore changed to a dash.
For example, the "jupyter_client" package is also listed as "jupyter-client" under the pip section.

Reproduce with:
conda create -y -n doublelist python=3.5
source activate doublelist
conda install -y jupyter_client
conda env export

Environment:


               platform : linux-64
          conda version : 4.3.8
       conda is private : False
      conda-env version : 4.3.8
    conda-build version : not installed
         python version : 3.5.2.final.0
       requests version : 2.12.4
       root environment : /opt/conda  (writable)
    default environment : /opt/conda
       envs directories : /opt/conda/envs
          package cache : /opt/conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : None
           offline mode : False
             user-agent : conda/4.3.8 requests/2.12.4 CPython/3.5.2 Linux/3.10.0-514.2.2.el7.x86_64 CentOS Linux/7.3.1611 glibc/2.17
                UID:GID : 0:0```
@kalefranz kalefranz added source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type labels May 9, 2017
@kalefranz
Copy link
Contributor

Is this still an issue in later versions of conda 4.3? Latest is 4.3.18.

@cfobel
Copy link

cfobel commented May 18, 2017

Yes, I just tested with the following setup:

               platform : win-32
          conda version : 4.3.18
       conda is private : False
      conda-env version : 4.3.18
    conda-build version : 2.1.10
         python version : 2.7.12.final.0
       requests version : 2.13.0
       root environment : C:\Users\chris\Miniconda2  (writable)
    default environment : C:\Users\chris\Miniconda2
       envs directories : C:\Users\chris\Miniconda2\envs
                          C:\Users\chris\AppData\Local\conda\conda\envs
                          C:\Users\chris\.conda\envs
          package cache : C:\Users\chris\Miniconda2\pkgs
                          C:\Users\chris\AppData\Local\conda\conda\pkgs
           channel URLs : https://conda.anaconda.org/wheeler-microfluidics/win-32
                          https://conda.anaconda.org/wheeler-microfluidics/noarch
                          https://conda.anaconda.org/conda-forge/win-32
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/free/win-32
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-32
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-32
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-32
                          https://repo.continuum.io/pkgs/msys2/noarch
            config file : C:\Users\chris\.condarc
           offline mode : False
             user-agent : conda/4.3.18 requests/2.13.0 CPython/2.7.12 Windows/10 Windows/10.0.14393
          administrator : unknown

I end up with the following entry in the dependencies: section of the export:

- !!python/unicode
  'jupyter_client=4.4.0=py27_0'

and a duplicate listing in the pip: section:

  - jupyter-client==4.4.0

Note the listing in the pip: section contains a hyphen while the listing in the dependencies: section contains an underscore.

@cfobel
Copy link

cfobel commented May 18, 2017

The issue stems from the following section code conda_env/pip_util.py:

    for pip_pkg in installed(prefix, output=output):
        if pip_pkg['name'] in conda_names and 'path' not in pip_pkg:
            continue
        installed_pkgs.add(str(pip_pkg))

The pip_pkg['name'] in conda_names check does not account for pip list replacing underscores in package names with hyphens. I'm not sure of the best way to solve this... Perhaps some type of fuzzy string matching, but that could potentially lead to false positives while still not catching all cases.

Any thoughts?

@kalefranz kalefranz added the easy label May 18, 2017
@kalefranz kalefranz added the good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward label Oct 12, 2017
@sachinbiradar9
Copy link

I believe this was fixed in PR #6438

@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Sep 18, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue great for new contributors, code change is envisioned to be trivial/relatively straight-forward locked [bot] locked due to inactivity source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type
Projects
None yet
Development

No branches or pull requests

4 participants