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

activate.bat script fails silently #4961

Closed
RodolpheGohard opened this issue Mar 29, 2017 · 23 comments
Closed

activate.bat script fails silently #4961

RodolpheGohard opened this issue Mar 29, 2017 · 23 comments
Labels
cli pertains to the CLI interface locked [bot] locked due to inactivity

Comments

@RodolpheGohard
Copy link

I use TeamCity to build a python project. The build steps are:

  1. check out project from vcs
  2. create a venv
  3. activate venv and run pip install

but step 3 fails when trying to activate, here is the windows bat script:

set PATH=C:\windows\system32
set PIP_CONFIG_FILE=%CONDA_VIRTUAL_ENV%\pip.ini

echo activatin'
%env.PYTHONHOME%\Scripts\activate %CONDA_VIRTUAL_ENV%
REM IT NEVER GETS PAST THIS, EXITS THE SCRIPT WITH CODE 0
echo activation done

pip.exe install -r %REQUIREMENTS%

I edited the activate.bat and remove any '@' or echo off and here is the output:

[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>REM @ symbols in this file indicate that output should not be printed. 
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>REM   Setting it this way allows us to not touch the user's echo setting. 
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>REM   For debugging, remove the @ on the section you need to study. 
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>setlocal enabledelayedexpansion 
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>set "CONDA_NEW_ENV=venv" 
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>SET "CONDA_EXE=C:\HOMEWARE\anaconda-2-x86_64\Scripts\\..\Scripts\conda.exe" 
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>CALL ECHO "venv"  | C:\Windows\System32\find.exe /I "-h"  1>NUL 
[18:17:14][Step 4/7] The system cannot find the drive specified.
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>IF NOT ERRORLEVEL 1 (call "C:\HOMEWARE\anaconda-2-x86_64\Scripts\\..\Scripts\conda.exe" ..activate "cmd.exe" -h )  else () 
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>echo env found 
[18:17:14][Step 4/7] env found
[18:17:14][Step 4/7] 
[18:17:14][Step 4/7] D:\BuildAgent\work\c8f664918c994f22>if "" == "" 
   ... Skipping some lines ...
[18:17:15][Step 4/7] ) 
[18:17:15][Step 4/7] 
[18:17:15][Step 4/7] (venv) D:\BuildAgent\work\c8f664918c994f22>echo script end 
[18:17:15][Step 4/7] script end
[18:17:15][Step 4/7] Process exited with code 0

note the "The system cannot find the drive specified." on CALL ECHO "venv" | C:\Windows\System32\find.exe /I "-h" 1>NUL

Why do I have this error, and why activate.bat also exists the outer script ? (with errorlevel 0)

@mingwandroid
Copy link
Contributor

When you say you create a venv do you mean you create a conda env?

@RodolpheGohard
Copy link
Author

Yes, I'm creating it with the following build step:

%env.PYTHONHOME%\Scripts\conda create -p %CONDA_VIRTUAL_ENV% python=%VIRTUAL_ENV_PYTHON_VERSION% --use-local --yes

Output:

[18:16:30][Step 1/7] Starting: D:\BuildAgent\temp\agentTmp\custom_script7404607095765454374.cmd
[18:16:30][Step 1/7] in directory: D:\BuildAgent\work\c8f664918c994f22
[18:16:36][Step 1/7] Fetching package metadata ...................
[18:16:36][Step 1/7] Solving package specifications: ..........
[18:17:13][Step 1/7] 
[18:17:13][Step 1/7] Package plan for installation in environment D:\BuildAgent\work\c8f664918c994f22\venv:
[18:17:13][Step 1/7] 
[18:17:13][Step 1/7] The following NEW packages will be INSTALLED:
[18:17:13][Step 1/7] 
[18:17:13][Step 1/7]     pip:            9.0.1-py35_1  https://xxxx:8443/artifactory/ext-conda-python-proxy-release (copy)
[18:17:13][Step 1/7]     python:         3.5.3-0       https://xxxx:8443/artifactory/ext-conda-python-proxy-release (copy)
[18:17:13][Step 1/7]     setuptools:     27.2.0-py35_1 https://xxxx:8443/artifactory/ext-conda-python-proxy-release (copy)
[18:17:13][Step 1/7]     vs2015_runtime: 14.0.25123-0  https://xxxx:8443/artifactory/ext-conda-python-proxy-release (copy)
[18:17:13][Step 1/7]     wheel:          0.29.0-py35_0 https://xxxx:8443/artifactory/ext-conda-python-proxy-release (copy)
[18:17:13][Step 1/7] 
[18:17:13][Step 1/7] Linking packages ...
[18:17:13][Step 1/7] [                    ]|                                                  |   0%
[18:17:13][Step 1/7] [vs2015_runtime      ]|                                                  |   0%
[18:17:13][Step 1/7] [python              ]|##########                                        |  20%
[18:17:13][Step 1/7] [setuptools          ]|####################                              |  40%
[18:17:13][Step 1/7] [wheel               ]|##############################                    |  60%
[18:17:13][Step 1/7] [pip                 ]|########################################          |  80%
[18:17:13][Step 1/7] [      COMPLETE      ]|##################################################| 100%
[18:17:13][Step 1/7] #
[18:17:13][Step 1/7] # To activate this environment, use:
[18:17:13][Step 1/7] # > activate D:\BuildAgent\work\c8f664918c994f22\venv
[18:17:13][Step 1/7] #
[18:17:13][Step 1/7] # To deactivate this environment, use:
[18:17:13][Step 1/7] # > deactivate
[18:17:13][Step 1/7] #
[18:17:13][Step 1/7] Using Anaconda Cloud api site https://api.anaconda.org
[18:17:13][Step 1/7] Process exited with code 0

@mingwandroid
Copy link
Contributor

Do you have find.exe in that location?

@RodolpheGohard
Copy link
Author

Yes, that's why I added:

set PATH=C:\windows\system32

(teamcity cleans the environnement for the build step and provides an empty path)

@mingwandroid
Copy link
Contributor

mingwandroid commented Mar 29, 2017

Please show the output from %SystemRoot%\System32\find.exe /h

And also that from:
set

If possible from a teamcity invoked command processor.

@RodolpheGohard
Copy link
Author

Let me correct my above statement, I needed to set the path because of a reference to "cmd" somewhere else in activate.bat. find.exe is there.

@mingwandroid
Copy link
Contributor

If teamcity is stripping out such a fundamental element of PATH then I am not surprised that things go wrong. I wonder what other environmental damage it considers acceptable. set should reveal that.

@RodolpheGohard
Copy link
Author

RodolpheGohard commented Mar 29, 2017

here is the output:

[14:52:44][Step 6/10] Starting: D:\BuildAgent\temp\agentTmp\custom_script7307809045172904252.cmd
[14:52:44][Step 6/10] in directory: D:\BuildAgent\work\c8f664918c994f22
[14:52:44][Step 6/10] 'C:\Windows\find.exe' is not recognized as an internal or external command,
[14:52:44][Step 6/10] operable program or batch file.
[14:52:44][Step 6/10] C:\Windows\find.exe /h:
[14:52:44][Step 6/10] set says:
[14:52:44][Step 6/10] ALLUSERSPROFILE=C:\ProgramData
[14:52:44][Step 6/10] APPDATA=C:\Users\faedev01\AppData\Roaming
[14:52:44][Step 6/10] BUILD_NUMBER=10
[14:52:44][Step 6/10] BUILD_VCS_NUMBER=291b9e0c92c32f96fdc440e67eed55d9511726cb
[14:52:44][Step 6/10] BUILD_VCS_NUMBER_CdoMarkEng_Smp_Continuous_xxxx=291b9e0c92c32f96fdc440e67eed55d9511726cb
[14:52:44][Step 6/10] CommonProgramFiles=C:\Program Files (x86)\Common Files
[14:52:44][Step 6/10] CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
[14:52:44][Step 6/10] CommonProgramW6432=C:\Program Files\Common Files
[14:52:44][Step 6/10] COMPUTERNAME=COMPUTER003
[14:52:44][Step 6/10] ComSpec=C:\Windows\system32\cmd.exe
[14:52:44][Step 6/10] CONDA_DEFAULT_ENV=D:\BuildAgent\work\c8f664918c994f22\venv
[14:52:44][Step 6/10] CONDA_ENV_PATH=D:\BuildAgent\work\c8f664918c994f22\venv;D:\BuildAgent\work\c8f664918c994f22\venv\Scripts;D:\BuildAgent\work\c8f664918c994f22\venv\Library\bin;D:\BuildAgent\work\c8f664918c994f22\venv\Lib
[14:52:44][Step 6/10] FP_NO_HOST_CHECK=NO
[14:52:44][Step 6/10] HOMEWARE=C:\Homeware
[14:52:44][Step 6/10] JAVA_HOME=C:\Program Files\Java\jdk1.8.0_92
[14:52:44][Step 6/10] JDK_18=C:\Program Files\Java\jdk1.8.0_92
[14:52:44][Step 6/10] JDK_18_x64=C:\Program Files\Java\jdk1.8.0_92
[14:52:44][Step 6/10] JDK_HOME=C:\Program Files\Java\jdk1.8.0_92
[14:52:44][Step 6/10] JRE_HOME=C:\Program Files\Java\jre1.8.0_92
[14:52:44][Step 6/10] LOCALAPPDATA=C:\Users\faedev01\AppData\Local
[14:52:44][Step 6/10] NO_LOGIN_SCRIPT=True
[14:52:44][Step 6/10] NUMBER_OF_PROCESSORS=2
[14:52:44][Step 6/10] OS=Windows_NT
[14:52:44][Step 6/10] Path=C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Progra~2\WINDOWS RESOURCE KITS\TOOLS\;C:\Windows\System32\WindowsPowerShell\v1.0\;%SGBUILD%\SCRIPTS;%SGBUILD%\LOGS;C:\Progra~2\Puppet Labs\Puppet\bin;C:\Program Files\Microsoft SQL Server\100\Tools\Binn;C:\Program Files (x86)\PDFtk\bin
[14:52:44][Step 6/10] PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
[14:52:44][Step 6/10] PROCESSOR_ARCHITECTURE=x86
[14:52:44][Step 6/10] PROCESSOR_ARCHITEW6432=AMD64
[14:52:44][Step 6/10] PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 45 Stepping 2, GenuineIntel
[14:52:44][Step 6/10] PROCESSOR_LEVEL=6
[14:52:44][Step 6/10] PROCESSOR_REVISION=2d02
[14:52:44][Step 6/10] ProgramData=C:\ProgramData
[14:52:44][Step 6/10] ProgramFiles=C:\Program Files (x86)
[14:52:44][Step 6/10] ProgramFiles(x86)=C:\Program Files (x86)
[14:52:44][Step 6/10] ProgramW6432=C:\Program Files
[14:52:44][Step 6/10] PROMPT=$P$G
[14:52:44][Step 6/10] PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
[14:52:44][Step 6/10] PUBLIC=C:\Users\Public
[14:52:44][Step 6/10] Python.2=C:\HOMEWARE\anaconda-2-x86_64\
[14:52:44][Step 6/10] PYTHONHOME=C:\HOMEWARE\anaconda-2-x86_64
[14:52:44][Step 6/10] PYTHONPATH=D:\BuildAgent\work\c8f664918c994f22;D:\BuildAgent\work\c8f664918c994f22\venv\Lib\site-packages
[14:52:44][Step 6/10] SGBUILD=C:\Program Files\SGBUILD
[14:52:44][Step 6/10] SystemDrive=C:
[14:52:44][Step 6/10] SystemRoot=C:\Windows
[14:52:44][Step 6/10] TEAMCITY_BUILDCONF_NAME=Build then deploy API on Artifactory Copy
[14:52:44][Step 6/10] TEAMCITY_BUILD_PROPERTIES_FILE=D:\BuildAgent\temp\buildTmp\teamcity.build3989235276202990900.properties
[14:52:44][Step 6/10] TEAMCITY_CAPTURE_ENV="D:\BuildAgent\jre\bin\java.exe" -jar "D:\BuildAgent\plugins\environment-fetcher\bin\env-fetcher.jar"
[14:52:44][Step 6/10] TEAMCITY_JRE=C:\Program Files\Java\jdk1.8.0_92
[14:52:44][Step 6/10] TEAMCITY_PROCESS_FLOW_ID=27996977480813300
[14:52:44][Step 6/10] TEAMCITY_PROCESS_PARENT_FLOW_ID=
[14:52:44][Step 6/10] TEAMCITY_PROJECT_NAME=Smp UAT
[14:52:44][Step 6/10] TEAMCITY_VERSION=9.1 (build 36973)
[14:52:44][Step 6/10] TEMP=D:\BuildAgent\temp\buildTmp
[14:52:44][Step 6/10] TMP=D:\BuildAgent\temp\buildTmp
[14:52:44][Step 6/10] TMPDIR=D:\BuildAgent\temp\buildTmp
[14:52:44][Step 6/10] TOOLS=C:\Program Files\_tools
[14:52:44][Step 6/10] UATDATA=C:\Windows\CCM\UATData\xxxxxx-CAB8-491d-B8AC-179A1FE1BE77
[14:52:44][Step 6/10] USERDNSDOMAIN=EUR.DOMAIN
[14:52:44][Step 6/10] USERDOMAIN=EUR
[14:52:44][Step 6/10] USERNAME=faedev01
[14:52:44][Step 6/10] USERPROFILE=C:\Users\faedev01
[...]
[14:52:44][Step 6/10] windir=C:\Windows
[14:52:44][Step 6/10] windows_tracing_flags=3
[14:52:44][Step 6/10] windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
[14:52:44][Step 6/10] WRAPPER_ARCH=x86
[14:52:44][Step 6/10] WRAPPER_BITS=32
[14:52:44][Step 6/10] WRAPPER_FILE_SEPARATOR=\
[14:52:44][Step 6/10] WRAPPER_OS=windows
[14:52:44][Step 6/10] WRAPPER_PATH_SEPARATOR=;
[14:52:44][Step 6/10] activatin'
[14:52:45][Step 6/10] Process exited with code 0

I'm a bit surprised, that's not what I got in my previous tests, I'm gonna look into it more closely

@mingwandroid
Copy link
Contributor

Ah, you are missing a System32 from the find.exe invocation. This is my fault as I typed #4961 (comment) on my phone without checking it, then edited it a few minutes later once I spotted my mistake when testing on Windows.

@RodolpheGohard
Copy link
Author

RodolpheGohard commented Mar 29, 2017

Yes, I saw that but find.exe is well present in system32:

%SystemRoot%\System32\find.exe /h says FIND: Invalid switch

the command in activate.bat is find.exe /I "-h" piped with the output of echo 'venv'.

and CALL ECHO "venv" | C:\Windows\System32\find.exe /I "-h" outputs nothing

@RodolpheGohard
Copy link
Author

Actually, I have trouble understanding what's the point of this line, I commented here where it appeared first in the repo but with no answer yet:

9785342

@RodolpheGohard
Copy link
Author

RodolpheGohard commented Mar 29, 2017

Sorry for spamming, update:

I just changed from %env.PYTHONHOME%\Scripts\activate %CONDA_VIRTUAL_ENV% to CALL %env.PYTHONHOME%\Scripts\activate %CONDA_VIRTUAL_ENV% and now, it doesn't exit the parent script anymore.

But the activate doesn't seem to be done properly as the subsequent pip install fails:

[15:17:25][Step 3/10] activatin'
[15:17:26][Step 3/10] Fatal Python error: Py_Initialize: unable to load the file system codec
[15:17:26][Step 3/10]   File "C:\HOMEWARE\anaconda-2-x86_64\lib\encodings\__init__.py", line 123
[15:17:26][Step 3/10]     raise CodecRegistryError,\
[15:17:26][Step 3/10]                             ^
[15:17:26][Step 3/10] SyntaxError: invalid syntax
[15:17:26][Step 3/10] 
[15:17:26][Step 3/10] Current thread 0x000011fc (most recent call first):
[15:17:28][Step 3/10] Process exited with code 255
[15:17:28][Step 3/10] Step activate (Command Line) failed

The venv I built was using python 3, and here we see pip install is running into the system python and not in the venv.

@RodolpheGohard
Copy link
Author

RodolpheGohard commented Mar 29, 2017

displaying SET after activate.bat gives this:

[15:31:18][Step 3/10] ALLUSERSPROFILE=C:\ProgramData
...
[15:31:18][Step 3/10] ComSpec=C:\Windows\system32\cmd.exe
[15:31:18][Step 3/10] CONDA_DEFAULT_ENV=venv
[15:31:18][Step 3/10] CONDA_ENV_PATH=D:\BuildAgent\work\c8f664918c994f22\venv;D:\BuildAgent\work\c8f664918c994f22\venv\Scripts;D:\BuildAgent\work\c8f664918c994f22\venv\Library\bin;D:\BuildAgent\work\c8f664918c994f22\venv\Lib
[15:31:18][Step 3/10] CONDA_PREFIX=D:\BuildAgent\work\c8f664918c994f22\venv
[15:31:18][Step 3/10] CONDA_PS1_BACKUP=$P$G
[15:31:18][Step 3/10] FP_NO_HOST_CHECK=NO
[15:31:18][Step 3/10] HOMEWARE=C:\Homeware
[15:31:18][Step 3/10] JAVA_HOME=C:\Program Files\Java\jdk1.8.0_92
[15:31:18][Step 3/10] JDK_18=C:\Program Files\Java\jdk1.8.0_92
[15:31:18][Step 3/10] JDK_18_x64=C:\Program Files\Java\jdk1.8.0_92
[15:31:18][Step 3/10] JDK_HOME=C:\Program Files\Java\jdk1.8.0_92
[15:31:18][Step 3/10] JRE_HOME=C:\Program Files\Java\jre1.8.0_92
[15:31:18][Step 3/10] LOCALAPPDATA=C:\Users\faedev01\AppData\Local
[15:31:18][Step 3/10] NO_LOGIN_SCRIPT=True
[15:31:18][Step 3/10] NUMBER_OF_PROCESSORS=2
[15:31:18][Step 3/10] OS=Windows_NT
[15:31:18][Step 3/10] Path=D:\BuildAgent\work\c8f664918c994f22\venv;D:\BuildAgent\work\c8f664918c994f22\venv\Library\mingw-w64\bin;D:\BuildAgent\work\c8f664918c994f22\venv\Library\usr\bin;D:\BuildAgent\work\c8f664918c994f22\venv\Library\bin;D:\BuildAgent\work\c8f664918c994f22\venv\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Progra~2\WINDOWS RESOURCE KITS\TOOLS\;C:\Windows\System32\WindowsPowerShell\v1.0\;%SGBUILD%\SCRIPTS;%SGBUILD%\LOGS;C:\Progra~2\Puppet Labs\Puppet\bin;C:\Program Files\Microsoft SQL Server\100\Tools\Binn;C:\Program Files (x86)\PDFtk\bin;C:\windows\system32
[15:31:18][Step 3/10] PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
[15:31:18][Step 3/10] PIP_CONFIG_FILE=venv\pip.ini
...
[15:31:18][Step 3/10] ProgramData=C:\ProgramData
[15:31:18][Step 3/10] ProgramFiles=C:\Program Files (x86)
[15:31:18][Step 3/10] ProgramFiles(x86)=C:\Program Files (x86)
[15:31:18][Step 3/10] ProgramW6432=C:\Program Files
[15:31:18][Step 3/10] PROMPT=(venv) $P$G
...
[15:31:18][Step 3/10] Python.2=C:\HOMEWARE\anaconda-2-x86_64\
[15:31:18][Step 3/10] PYTHONHOME=C:\HOMEWARE\anaconda-2-x86_64
[15:31:18][Step 3/10] PYTHONPATH=D:\BuildAgent\work\c8f664918c994f22;D:\BuildAgent\work\c8f664918c994f22\venv\Lib\site-packages
[15:31:18][Step 3/10] SGBUILD=C:\Program Files\SGBUILD
[15:31:18][Step 3/10] SystemDrive=C:
[15:31:18][Step 3/10] SystemRoot=C:\Windows
...
[15:31:18][Step 3/10] TEAMCITY_VERSION=9.1 (build 36973)
[15:31:18][Step 3/10] TEMP=D:\BuildAgent\temp\buildTmp
[15:31:18][Step 3/10] TMP=D:\BuildAgent\temp\buildTmp
[15:31:18][Step 3/10] TMPDIR=D:\BuildAgent\temp\buildTmp
[15:31:18][Step 3/10] TOOLS=C:\Program Files\_tools
[15:31:18][Step 3/10] UATDATA=C:\Windows\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
...
[15:31:18][Step 3/10] windir=C:\Windows
[15:31:18][Step 3/10] windows_tracing_flags=3
[15:31:18][Step 3/10] windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
[15:31:18][Step 3/10] WRAPPER_ARCH=x86
[15:31:18][Step 3/10] WRAPPER_BITS=32
[15:31:18][Step 3/10] WRAPPER_FILE_SEPARATOR=\
[15:31:18][Step 3/10] WRAPPER_OS=windows
[15:31:18][Step 3/10] WRAPPER_PATH_SEPARATOR=;

I don't know why PYTHON_HOME still points to the old location, but forcing it to point to the new virtualenv with:
SET PYTHONHOME=%%CONDA_PREFIX%% Does the job ! And pip install runs fine from then.

Is activate supposed to set this pythonhome env var like this ?

@mingwandroid
Copy link
Contributor

I would never use %PYTHONHOME% and we don't set it. To me it has always felt like a legacy thing.

@RodolpheGohard
Copy link
Author

Yeah, it feels like an ugly workaround, but I can't figure why pip install doesn't use the venv properly if I don't set that.

Especially when I can see the path seems well defined: Path=D:\BuildAgent\work\c8f664918c994f22\venv;D:\BuildAgent\work\c8f664918c994f22\venv\Library\mingw-w64\bin;D:\BuildAgent\work\c8f664918c994f22\venv\Library\usr\bin;D:\BuildAgent\work\c8f664918c994f22\venv\Library\bin;D:\BuildAgent\work\c8f664918c994f22\venv\Scripts;

And where pip points to the venv also.

@RodolpheGohard
Copy link
Author

RodolpheGohard commented Mar 29, 2017

I forgot, but thank you @mingwandroid for the support and quick responses. It helped a lot :)

@mingwandroid
Copy link
Contributor

No problem, I'd like to take you up on a minor issue with definitions, I'd appreciate it if you didn't refer to conda envs as virtualenvs or venvs.

virtualenv is an entirely different project and that is what creates the things I call venvs or virtualenvs. Calling conda envs that just muddies the waters here. Also, to my mind, virtualenvs are so called because of the level of hackery they perform to create the illusion of environmental separation (which falls apart at times) while conda envs perform much less of that and, therefore I feel don't deserve the virtual prefix.

That aside once you have activated your conda env correctly, what output do you get from where python and where pip?

@mingwandroid
Copy link
Contributor

Ah, earlier I meant to say, show the output from %SystemRoot%\System32\find.exe /?

@RodolpheGohard
Copy link
Author

Thanks for the clarification and sorry for the confusion. As you may have guessed, I've entered only recently into the python ecosystem. If it were only for me, I think I'd use docker to isolate all this stuff :)

here are the commands:

[16:10:29][Step 3/10] where are python and pip ?
[16:10:29][Step 3/10] D:\BuildAgent\work\c8f664918c994f22\venv\python.exe
[16:10:29][Step 3/10] D:\BuildAgent\work\c8f664918c994f22\venv\Scripts\pip.exe

as for find:

[16:11:13][Step 1/1] Starting: D:\BuildAgent\temp\agentTmp\custom_script1390562909640392212.cmd
[16:11:13][Step 1/1] in directory: D:\BuildAgent\work\87a8249e8e74b80b
[16:11:14][Step 1/1] Searches for a text string in a file or files.
[16:11:14][Step 1/1] 
[16:11:14][Step 1/1] FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]
[16:11:14][Step 1/1] 
[16:11:14][Step 1/1]   /V         Displays all lines NOT containing the specified string.
[16:11:14][Step 1/1]   /C         Displays only the count of lines containing the string.
[16:11:14][Step 1/1]   /N         Displays line numbers with the displayed lines.
[16:11:14][Step 1/1]   /I         Ignores the case of characters when searching for the string.
[16:11:14][Step 1/1]   /OFF[LINE] Do not skip files with offline attribute set.
[16:11:14][Step 1/1]   "string"   Specifies the text string to find.
[16:11:14][Step 1/1]   [drive:][path]filename
[16:11:14][Step 1/1]              Specifies a file or files to search.
[16:11:14][Step 1/1] 
[16:11:14][Step 1/1] If a path is not specified, FIND searches the text typed at the prompt
[16:11:14][Step 1/1] or piped from another command.
[16:11:14][Step 1/1] Process exited with code 0

@mingwandroid
Copy link
Contributor

I think the root of your issue is that you didn't install pip into your new environment when you created it. Try:

%env.PYTHONHOME%\Scripts\conda create -p %CONDA_VIRTUAL_ENV% python=%VIRTUAL_ENV_PYTHON_VERSION% pip --use-local --yes

Also, are the things you are using pip to install available as conda packages? If so you should prefer to use conda to install them.

@wulmer
Copy link
Contributor

wulmer commented Mar 29, 2017 via email

@mingwandroid
Copy link
Contributor

Good point about call, I failed to spot that part.

@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 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 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
Projects
None yet
Development

No branches or pull requests

5 participants