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

WIP: create function to activate env #86

Closed

Conversation

abhijeetSaroha
Copy link
Collaborator

Solves #52

@abhijeetSaroha
Copy link
Collaborator Author

@xmnlab , It gives error that conda or mamba should be init before activate/deactivate command. But I tried to init the shell but it still give same error.

Have you any suggestion?
image

Comment on lines +147 to +158
sh.Command('xonsh')(
'-c',
f'{app} init xonsh',
_in=sys.stdin,
_out=sys.stdout,
_err=sys.stderr,
_bg=False,
_bg_exc=False,
_no_err=True,
_env=os.environ,
_new_session=False,
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, I try to initialize the shell.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking, also with this code, it is not working, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure because when I try with mamba (app), it will initialise in the shell but I don't think it performs the same with conda as mamba.

But after the initialisation of mamba in the shell, it still gives the same error.

@xmnlab
Copy link
Member

xmnlab commented Jan 20, 2024

Hi @abhijeetSaroha ! To be honest I had this issue before in different situations, but I don't know why. I am going to check with a friend from conda-forge to see if I can have some clues about that.

Thanks for working on that.

@xmnlab
Copy link
Member

xmnlab commented Jan 20, 2024

I will try to investigate it a bit tomorrow.

@xmnlab
Copy link
Member

xmnlab commented Jan 21, 2024

update: I will take a look into this tomorrow. I have more stuff in my backlog XD

@xmnlab
Copy link
Member

xmnlab commented Jan 25, 2024

@abhijeetSaroha , sorry .. I didn't have time to take a look into that yet, really sorry ... some bunch of problems are popping-up at work .. really sorry :(

but I would like to share some thoughts here:

  • so commonly, we use bash and we have it configure to have conda in the system path.
  • if we are using makim without any specific bash, it uses xonsh
  • so my first impression is that it is not the responsibility of makim to initialize conda for all the possible consoles, also because sometimes we are not using a console but a programming language

have you tested running the conda init for xonsh outside first? maybe also for sh as well .. to see if that would work.
of course, after that, it is necessary to restart the console session

@xmnlab
Copy link
Member

xmnlab commented Feb 6, 2024

@abhijeetSaroha , when you have time, could you add a test for that?

@xmnlab
Copy link
Member

xmnlab commented Mar 18, 2024

@abhijeetSaroha , although this PR is a bit blocked, but just for the record, maybe another approach would be using pixi: https://prefix.dev/blog/introducing_multi_env_pixi

@xmnlab
Copy link
Member

xmnlab commented Sep 8, 2024

this is a very old PR .. but just to bring some ideas about this topic .. maybe we could use nox to intermediate this.
in another words, I think we should create something like a plugin to nox and if the user wants to play with virtual environments, maybe the way to go would be via nox

@abhijeetSaroha abhijeetSaroha closed this by deleting the head repository Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants