-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
When you say you create a venv do you mean you create a conda env? |
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:
|
Do you have find.exe in that location? |
Yes, that's why I added:
(teamcity cleans the environnement for the build step and provides an empty path) |
Please show the output from And also that from: If possible from a teamcity invoked command processor. |
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. |
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. |
here is the output:
I'm a bit surprised, that's not what I got in my previous tests, I'm gonna look into it more closely |
Ah, you are missing a |
Yes, I saw that but find.exe is well present in system32:
the command in activate.bat is find.exe /I "-h" piped with the output of echo 'venv'. and |
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: |
Sorry for spamming, update: I just changed from But the activate doesn't seem to be done properly as the subsequent pip install fails:
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. |
displaying SET after activate.bat gives this:
I don't know why PYTHON_HOME still points to the old location, but forcing it to point to the new virtualenv with: Is activate supposed to set this pythonhome env var like this ? |
I would never use |
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 |
I forgot, but thank you @mingwandroid for the support and quick responses. It helped a lot :) |
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
That aside once you have activated your conda env correctly, what output do you get from |
Ah, earlier I meant to say, show the output from |
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:
as for find:
|
I think the root of your issue is that you didn't install pip into your new environment when you created it. Try:
Also, are the things you are using |
When using activate.bat in a batch script, you have to 'call' it:
call activate.bat envname
This is like sourcing on Linux shells. Otherwise, the changes in the Env
variables are not applied to the calling environment.
Ray Donnelly <notifications@github.com> schrieb am Mi., 29. März 2017,
16:25:
… 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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4961 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABmEoZsp6Mv1c0AgtVdKZXic6KrQryo6ks5rqmnXgaJpZM4Ms3-b>
.
|
Good point about |
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. |
I use TeamCity to build a python project. The build steps are:
but step 3 fails when trying to activate, here is the windows bat script:
I edited the activate.bat and remove any '@' or echo off and here is the output:
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)
The text was updated successfully, but these errors were encountered: