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

Powershell activate and deactivate #626

Closed
asmeurer opened this issue Mar 28, 2014 · 74 comments
Closed

Powershell activate and deactivate #626

asmeurer opened this issue Mar 28, 2014 · 74 comments
Labels
cli pertains to the CLI interface help-wanted we don't know the solution or we especially want a community member to contribute the code change locked [bot] locked due to inactivity os::windows relevant to Windows source::governance created by members of the conda governance (https://github.com/conda-incubator/governance) type::feature request for a new feature or capability

Comments

@asmeurer
Copy link
Contributor

See https://github.com/Liquidmantis/PSCondaEnvs.

@asmeurer
Copy link
Contributor Author

@meawoppl
Copy link

Honestly just adding those scripts to the distribution seems to work flawlessly on win7-64bit. Would you like a PR for this?

@asmeurer
Copy link
Contributor Author

Sure, but see also #913

@meawoppl
Copy link

Ahh, seems like that deals with it all much more nicely. Thanks for the ref.

@rossant
Copy link

rossant commented Jan 2, 2015

Will #913 work in Powershell? If not, would it be worth just adding the ps scripts to the distribution?

@Ivoz
Copy link

Ivoz commented Sep 15, 2015

Is there anything bad about just including ps scripts while you figure out #913 ? I thought conda was supposed to be advertised as more featureful than virtualenv :P

@liujimj
Copy link

liujimj commented Oct 17, 2015

Just to chime in, I also wasted about an hour of time figuring out why my environments weren't activating.

Anaconda envs are advertised as full-featured replacements for venv, so I would expect Powershell support.

@msarahan
Copy link
Contributor

If @Liquidmantis or anyone else wants to submit the ps scripts that @rossant mentioned, I'll merge them. It would be nice to not include another license file with Conda. I the meantime, we are reviewing #913 and its newer derivatives and hope to merge it soon.

@Liquidmantis
Copy link

I'm fine with them being added, and was going to submit a PR now, but it looks like conda has been reworked and the old bat files have been removed anyway so I'm not sure how to proceed.

@msarahan
Copy link
Contributor

Things are in a little bit of flux right now. The activate scripts were moved out of conda, into conda-env. This has unfortunately made the activate scripts harder to test, since they effectively depend on two packages. We will be discussing this after the Anaconda 2.4.1 release, and hopefully coming up with a better arrangement. If you put a PR in against conda-env, we'll be happy to consider it, and we'll take care of any moves necessary thereafter.

@masaeedu
Copy link

@msarahan It looks like the Anaconda 2.5 release is out now. Has there been any progress on this? It would greatly improve the Windows UX if this could be fixed. 🙏

@vmuriart
Copy link

@Liquidmantis Seems like the old bat files have been added back. I just tested your scripts from pscondaenvs and they work with conda 4.0.5.

#913 was closed in favor or #1727, but it didn't address the powershell issue.
@msarahan would you still accept the pr if @Liquidmantis or anyone else submits them?

@msarahan
Copy link
Contributor

Sorry for the delay here. Absolutely.

Before they are accepted, they need to pass the test_activate.py tests. I added a bit of scaffolding for powershell, but didn't want to bloat #1727 any further. Please see this comment for how to run the tests with the new shell (modify test_activate.py, but also pass a command-line argument): #1727 (comment)

Ping me if you are working on this and need help.

@vmuriart
Copy link

@msarahan just took a look at this today to get it added. Might take me a bit to implement the Powershell test. Just noticed that the section on it is just an exception :person_frowning:

@msarahan
Copy link
Contributor

@vmuriart go ahead with a PR whenever, even if tests are not passing. I'll be happy to help you flesh out the framework.

vmuriart added a commit to vmuriart/conda that referenced this issue Apr 17, 2016
vmuriart added a commit to vmuriart/conda that referenced this issue Apr 17, 2016
@Gemma-Rate
Copy link

+1, encountering this issue on windows 10.

@JaimieMurdock
Copy link

+1 again, just ran into this again trying to do Py3 testing.

@kenodegard
Copy link
Contributor

Addressed with #3175 and #3960

@schlichtanders
Copy link

Is there any progress on this? just tried https://github.com/Liquidmantis/PSCondaEnvs, but they break
and executing activate.bat within powershell just hangs forever

@achembarpu
Copy link

Same here - I'm very confused about the lack of working PowerShell support.

@kalefranz
Copy link
Contributor

If anyone following this thread would like to contribute, #6471 sketches out the start of what a powershell wrapper might look like under the conda 4.4+ framework. The #6471 PR has additional instruction and comments. A new PR that follows the same patterns established by the five other shell wrappers, and as sketched out in #6471, would be very welcome.

@kalefranz kalefranz added the help-wanted we don't know the solution or we especially want a community member to contribute the code change label Jul 31, 2018
@musm
Copy link

musm commented Sep 24, 2018

bump desperately seeking Powershell support

@kalefranz
Copy link
Contributor

kalefranz commented Sep 25, 2018 via email

@kalefranz
Copy link
Contributor

Resolved by #7794. Will be included in conda 4.6.

@rhaejr
Copy link

rhaejr commented Oct 10, 2018

This is still messed up with Powershell with current anaconda version.

@mingwandroid
Copy link
Contributor

mingwandroid commented Oct 10, 2018 via email

@Maxl94
Copy link

Maxl94 commented Nov 18, 2018

@mingwandroid Any progress? I recently downloaded anaconda 5.3, but activate is still not working with ps. Or is there some trick?

@mingwandroid
Copy link
Contributor

mingwandroid commented Nov 18, 2018

It'll be part of conda 4.6 I think. I cannot give a reliable timeline for that at present though, sorry.

@cooknl
Copy link

cooknl commented Jan 29, 2019

https://www.anaconda.com/blog/developer-blog/conda-4-6-release/

Looks like it made it in

@pkuderov
Copy link

pkuderov commented Feb 4, 2019

https://www.anaconda.com/blog/developer-blog/conda-4-6-release/

The link is broken. Here's the working one https://www.anaconda.com/conda-4-6-release/

Still, great job, guys!

@giuliofoletto
Copy link

Correct me if I'm wrong, with the current solution (conda 4.6) an instance of python runs at startup of any Powershell process querying for the active environment, and its name is printed at the beginning of the prompt. This does not seem optimal because it slows down the loading of the shell even if the user is not interested in actually working with conda. The implementation in cmd seems to be better because conda runs only when actively requested by the user (via conda activate) and information about the environment disappears when no longer needed (deactivate). Shouldn't it behave in the same way in Powershell?

@vidartf
Copy link

vidartf commented Feb 22, 2019

@giuliofoletto I think it would be better if you opened up a new issue for discussing possible enhancements to the current implementation of this. Having a new, open issue should help with visibility of your concerns.

@amritaputrab
Copy link

Conda version: conda 4.6.11
Windows 10

Looks like the conda activate <new_env> is actually still pointing to the base environment.
And if you install new packages, assuming that you are actually installing in the new_env, it will install in the base env. So, please beware!

e.g. I did the following:
1.
conda env list >>
base * C:\Users\abcd\AppData\Local\Continuum\anaconda3
envp3 C:\Users\abcd\AppData\Local\Continuum\anaconda3\envs\envp3

conda activate envp3
conda env list >>
base * C:\Users\abcd\AppData\Local\Continuum\anaconda3
envp3 C:\Users\abcd\AppData\Local\Continuum\anaconda3\envs\envp3

conda install -c conda-forge tldextract >>
environment location: C:\Users\abcd\AppData\Local\Continuum\anaconda3
That is, it is installing in my base env.

Another issue:
If I do conda init powershell>>
then restarting my powershell, ps is getting initialized with base env. Now if I want to activate envp3, it is crashing. same with deactivate.

Let me know if I am doing anything wrong.

@sleighsoft
Copy link

sleighsoft commented Apr 7, 2019

Having the same issue on Win10 with powershell after running conda init powershell. Conda 4.6.11 as well.

@GoingMyWay
Copy link

https://github.com/Liquidmantis/PSCondaEnvs. No longer supports.

@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 Aug 31, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 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 help-wanted we don't know the solution or we especially want a community member to contribute the code change locked [bot] locked due to inactivity os::windows relevant to Windows source::governance created by members of the conda governance (https://github.com/conda-incubator/governance) type::feature request for a new feature or capability
Projects
None yet
Development

No branches or pull requests