Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

568
Visualizações
How to activate a Conda Environment from the "sh" shell (on Nodejs)?

I can activate the Conda Environment with any problems from the bash shell. I can use this two options on bash:

source activate env_name
. activate env_name

But I am using the method exec of Node to run the activation of the environment. Node uses sh shell in order to run commands. I tried the commands above, but they did not work. I got this error

/bin/sh: 1: /env_name/bin/source: not found

So I had to use this command to run the environment

const child_process = require('child_process')
child_process.exec('bash -c "source activate env_name"')

Is there a better way to do this to make it work on Ubuntu?

I run this on Windows and it is enough to make it work

child_process.exec('activate env_name')
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Conda doesn't do well right now (in conda 4.3.x) with shells that aren't "advanced" like bash and zsh. Pure posix dash and the busybox shells, for example, don't work right now.

Good new though... They soon will. Support for a larger variety of shells is a feature of conda 4.4. The base PR for this work was https://github.com/conda/conda/pull/5044, and there are several follow-ons.

Conda 4.4.0 should be released into canary in the next several weeks.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda