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 messes up path on Windows and mingw64-git after any command #5036

Closed
ispmarin opened this issue Apr 11, 2017 · 19 comments
Closed

conda messes up path on Windows and mingw64-git after any command #5036

ispmarin opened this issue Apr 11, 2017 · 19 comments
Labels
cli pertains to the CLI interface 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

@ispmarin
Copy link

Using mingw64-git and Anaconda

`conda info
Current conda install:

           platform : win-64
      conda version : 4.3.16
   conda is private : False
  conda-env version : 4.3.16
conda-build version : not installed
     python version : 3.6.0.final.0
   requests version : 2.13.0
   root environment : C:\Users\user\bin\anaconda3  (writable)
default environment : C:\users\user\bin\envs\hcbda
   envs directories : C:\users\user\bin\envs
                      C:\Users\user\bin\anaconda3\envs
                      C:\Users\user\AppData\Local\conda\conda\envs
                      C:\Users\user\.conda\envs
      package cache : C:\Users\user\bin\anaconda3\pkgs
                      C:\Users\user\AppData\Local\conda\conda\pkgs
       channel URLs : https://repo.continuum.io/pkgs/free/win-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/r/win-64
                      https://repo.continuum.io/pkgs/r/noarch
                      https://repo.continuum.io/pkgs/pro/win-64
                      https://repo.continuum.io/pkgs/pro/noarch
                      https://repo.continuum.io/pkgs/msys2/win-64
                      https://repo.continuum.io/pkgs/msys2/noarch
        config file : C:\Users\user\.condarc
       offline mode : False
         user-agent : conda/4.3.16 requests/2.13.0 CPython/3.6.0 Windows/10 Windows/10.0.10586

`
after issuing any command (conda update, conda install, any command), no other command works, including commands from the shell (wget, etc), with "file not found" error.

@kalefranz
Copy link
Contributor

Can you give us the exact command line session from when this happens. And then after the error occurs, show us the output of env | sort.

@ispmarin
Copy link
Author

Sure thing:

    conda create -n test
    Fetching package metadata ...........
    Solving package specifications:
    Package plan for installation in environment C:\users\310277940\bin\envs\test:

    Proceed ([y]/n)? y

#

# To activate this environment, use:
# > activate test
#
# To deactivate this environment, use:
# > deactivate test
#
# * for power-users using bash, you must source
#

Next, activating it:

    source activate test

Installing a package:

$ conda install pandas
Fetching package metadata ...........
Solving package specifications: .

Package plan for installation in environment C:\users\310277940\bin\envs\test:

The following NEW packages will be INSTALLED:

    mkl:             2017.0.1-0         defaults
    numpy:           1.12.1-py36_0      defaults
    pandas:          0.19.2-np112py36_1 defaults
    pip:             9.0.1-py36_1       defaults
    python:          3.6.1-0            defaults
    python-dateutil: 2.6.0-py36_0       defaults
    pytz:            2017.2-py36_0      defaults
    setuptools:      27.2.0-py36_1      defaults
    six:             1.10.0-py36_0      defaults
    vs2015_runtime:  14.0.25123-0       defaults
    wheel:           0.29.0-py36_0      defaults

Proceed ([y]/n)? y

Everything working so far. Now, trying to install second package:

$ conda install ipython
bash: /C/users/310277940/bin/envs/test/Scripts/conda: No such file or directory
(test)

Failure. Result of env | sort:

$ env | sort
!::=::\
_=/usr/bin/env
ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\myuser\AppData\Roaming
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
COMMONPROGRAMFILES=C:\Program Files\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=mycomputer
COMSPEC=C:\WINDOWS\system32\cmd.exe
CONDA_DEFAULT_ENV=test
CONDA_PATH_BACKUP=/c/Users/myuser/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/myuser/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/PuTTY:/cmd:/c/Program Files (x86)/GNU/GnuPG/pub:/c/Program Files/OpenVPN/bin:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Users/myuser/bin/anaconda3:/c/Users/myuser/bin/anaconda3/Scripts:/c/Users/myuser/bin/anaconda3/Library/bin:/c/Users/myuser/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64:/c/Users/myuser/bin/SublimeText:/c/Users/myuser/bin/R-3.3.2/bin/x64:/c/Users/myuser/bin/pandoc:/usr/bin/vendor_perl:/usr/bin/core_perl
CONDA_PREFIX=/C/users/myuser/bin/envs/test
CONDA_PS1_BACKUP=\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$
CONFIG_SITE=/mingw64/etc/config.site
DEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection
DISPLAY=needs-to-be-defined
EXEPATH=C:\Program Files\Git
FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
FPS_BROWSER_USER_PROFILE_STRING=Default
HOME=/c/Users/myuser
HOMEDRIVE=C:
HOMEPATH=\Users\myuser
HOSTNAME=mycomputer
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
JUPYTER_CONFIG_DIR=C:\Users\myuser\.jupyter
JUPYTER_PATH=C:\Users\myuser\.jupyter
LANG=pt_BR.UTF-8
LOCALAPPDATA=C:\Users\myuser\AppData\Local
MANPATH=/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man
MINGW_CHOST=x86_64-w64-mingw32
MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
MINGW_PREFIX=/mingw64
MSYS2_ENV_CONV_EXCL=CONDA_PATH
MSYSTEM_CARCH=x86_64
MSYSTEM_CHOST=x86_64-w64-mingw32
MSYSTEM_PREFIX=/mingw64
MSYSTEM=MINGW64
NUMBER_OF_PROCESSORS=4
OneDrive=C:\Users\myuser\OneDrive - Business
ORIGINAL_PATH=/mingw64/bin:/usr/bin:/c/Users/myuser/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/PuTTY:/cmd:/c/Program Files (x86)/GNU/GnuPG/pub:/c/Program Files/OpenVPN/bin:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Users/myuser/bin/anaconda3:/c/Users/myuser/bin/anaconda3/Scripts:/c/Users/myuser/bin/anaconda3/Library/bin:/c/Users/myuser/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64:/c/Users/myuser/bin/SublimeText:/c/Users/myuser/bin/R-3.3.2/bin/x64:/c/Users/myuser/bin/pandoc
ORIGINAL_TEMP=/tmp
ORIGINAL_TMP=/tmp
OS=Windows_NT
PATH=/C/users/myuser/bin/envs/test:/C/users/myuser/bin/envs/test/Library/mingw-w64/bin:/C/users/myuser/bin/envs/test/Library/usr/bin:/C/users/myuser/bin/envs/test/Library/bin:/C/users/myuser/bin/envs/test/Scripts:/c/Users/myuser/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/myuser/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/PuTTY:/cmd:/c/Program Files (x86)/GNU/GnuPG/pub:/c/Program Files/OpenVPN/bin:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Users/myuser/bin/anaconda3:/c/Users/myuser/bin/anaconda3/Scripts:/c/Users/myuser/bin/anaconda3/Library/bin:/c/Users/myuser/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64:/c/Users/myuser/bin/SublimeText:/c/Users/myuser/bin/R-3.3.2/bin/x64:/c/Users/myuser/bin/pandoc:/usr/bin/vendor_perl:/usr/bin/core_perl
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
PLINK_PROTOCOL=ssh
PRINTER=Microsoft Print to PDF
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3d04
ProgramData=C:\ProgramData
ProgramFiles(x86)=C:\Program Files (x86)
PROGRAMFILES=C:\Program Files
ProgramW6432=C:\Program Files
PS1=(test) \[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
PWD=/c/Users/myuser
SESSIONNAME=Console
SHELL=/usr/bin/bash
SHLVL=1
SSH_ASKPASS=/mingw64/libexec/git-core/git-gui--askpass
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINDOWS
TEMP=/tmp
TERM=xterm-256color
TMP=/tmp
TMPDIR=/tmp
USERDNSDOMAIN=domain.Business.COM
USERDOMAIN=domain
USERNAME=myuser
USERPROFILE=C:\Users\myuser
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VSEDEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection
WINDIR=C:\WINDOWS
(test)

@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 2, 2017
@kalefranz
Copy link
Contributor

This is a problem with activate and mingw64-git. We should be able to address it pretty easily now that we have #5044 merged.

@brechtm
Copy link

brechtm commented May 8, 2017

I have noticed that conda rebuilds the PATH environment variable using a semicolon ; (Windows style) instead of the colon : (POSIX style), completely breaking the search path in msys2.

@ispmarin
Copy link
Author

@brechtm could this be the cause of the failure on mingw64-git?

@brechtm
Copy link

brechtm commented May 17, 2017

@ispmarin Yes. I'm running conda 4.3.11 BTW.

@beachdweller
Copy link

Is someone working on this issue ? Or is it already resolved ?

@zwn
Copy link

zwn commented Jun 20, 2017

Which version of conda is the last one before the deactivate part got broken for msys by rebuilding the path "windows style" with semicolons? I've just updated conda only to find myself unable to deactivate 😟

@zwn
Copy link

zwn commented Jun 20, 2017

Versions 4.3.13 and 4.3.11 have semicolons bug.

Version 4.2.12 works with msys (git environment).

@brechtm
Copy link

brechtm commented Jun 27, 2017

With conda 4.3.22 in MSYS2, the PATH is still being rewritten using ; instead of : on deactivation of an env. The individual paths are also Windows-style (C:\Program Files\...) instead of UNIX style (/c/Program Files/...).

@beachdweller
Copy link

Which version of conda is the last one before the deactivate part got broken for msys by rebuilding the path "windows style" with semicolons? I've just updated conda only to find myself unable to deactivate 😟

@zwn @brechtm IMHO could you try 4.3.4?

jonokay added a commit to jonokay/conda that referenced this issue Jul 5, 2017
conda#5036

Write the PATH style based on the shell when deactivating. Fixes
deactivate in mingw64 on windows to write the PATH in Posix style
instead of Windows style.
@brechtm
Copy link

brechtm commented Jul 10, 2017

@Autodrive I can't install 4.3.4 since I'm using Python 3 Miniconda.

$ conda install conda=4.3.4
Fetching package metadata .............
Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:
  - conda 4.3.4* -> enum34 -> python 2.7*
  - python 3.6*
Use "conda info <package>" to see the dependencies for each package.

@zwn
Copy link

zwn commented Jul 10, 2017

@Autodrive 4.3.4 works with python 2.7 and it is my newly pinned version now 👍

@brechtm
Copy link

brechtm commented Jul 10, 2017

I believe the root cause is that conda (..deactivate.path in cli/activate.py) gets the PATH environment variable using os.environ['PATH'], which is different from the PATH in bash (echo $PATH).

One solution could be to pass the contents of PATH to conda ..deactivate.path. But this triggers MSYS2 path mangling, complicating things.

@brechtm
Copy link

brechtm commented Jul 10, 2017

@Autodrive I'm using "Miniconda3-latest-Windows-x86_64.exe" with "Product version" 4.3.11, Python 3.6.0 and conda 4.3.22.

Which conda version do you have installed?

@beachdweller
Copy link

@brechtm @zwn I am currently using Anaconda 4.2 (conda 4.3.22) + Python 3.5 +
on Windows and this version works fine, IMHO.

@kalefranz
Copy link
Contributor

This is a problem with activate and mingw64-git.

All flavors of bash on Windows should work pretty well as of conda 4.4.7. If there are any specific new problems, please file a new issue.

@brechtm
Copy link

brechtm commented Jan 25, 2018

Thanks! So far, I'm not seeing these issues anymore with conda 4.4.7 on MSYS2.

@mbargull mbargull added the cli pertains to the CLI interface label Mar 13, 2018
@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 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cli pertains to the CLI interface 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

6 participants