Giter VIP home page Giter VIP logo

Comments (17)

linda-farias avatar linda-farias commented on May 22, 2024 34

I found that on Google Colab the correct command is: ! activate + name. Then activated

Example:
! activate metawrap-env

Thank you so much!!

from code.

dekathomas avatar dekathomas commented on May 22, 2024 18

Hello, I have used this command

!activate alphapose
!conda env list

But it still don't change the environment in my google colab.

image

from code.

yeeyou avatar yeeyou commented on May 22, 2024 6

This works for me.
!source activate myenv && python -m spacy download en_core_web_sm

And you should add " !source activate myenv && " to every command you're going to call

from code.

1feres1 avatar 1feres1 commented on May 22, 2024 4

the same here
image

from code.

Ferx2226 avatar Ferx2226 commented on May 22, 2024 2

this helped me !conda env update -n base -f environment.yaml the new environment is generated and activated

Just to inform, it doesn't work for me (env-dev.yml is my file)
github

from code.

RajathPrabhu221 avatar RajathPrabhu221 commented on May 22, 2024 1

@linda-farias I believe you're trying to activate with $ in the command.
It should be: conda activate metawraptest-env

from code.

iVoider avatar iVoider commented on May 22, 2024 1

Seems like Colab is only able to use env only inside one code block.
So use it like this: !conda activate myenv && call myscript

from code.

Nov05 avatar Nov05 commented on May 22, 2024 1
  1. As someone mentioned previously, "it seems like Colab is only able to use env inside one code block".
  2. Also since Colab won't save your environment every time you shut down the runtime anyway.
  3. I would just install miniconda to get a "clean" environment and install everything in the base env (example notebook).
    !conda env update -n base -f conda-environment.yaml

Hope it would help.

from code.

zxers avatar zxers commented on May 22, 2024 1

This works!!!

from code.

linda-farias avatar linda-farias commented on May 22, 2024

I'm writing exactly that, but he doesn't recognize that command.

from code.

RajathPrabhu221 avatar RajathPrabhu221 commented on May 22, 2024

From what your shell reads, you have typed in $ in the command.

Taking it off should work fine

from code.

1feres1 avatar 1feres1 commented on May 22, 2024

this helped me
!conda env update -n base -f environment.yaml
the new environment is generated and activated

from code.

josephrocca avatar josephrocca commented on May 22, 2024

The condacolab PyPi package may be useful:

from code.

ccruzalegui avatar ccruzalegui commented on May 22, 2024

I have a very similar issue. I manage to clone, install conda and create the environment in colab. However I can't activate it, the star (*) sign is not even appearing at all. My notebook is here, perhaps someone can take a look.

https://colab.research.google.com/drive/1rGsVd8rbjFXZzqdIw9LnuEJd3z1sgo7H?usp=sharing

I have tried ($) sign, source command, update the base environment (as advised) but none work. stuck there for a couple of days already. help with any trick?

from code.

guccang avatar guccang commented on May 22, 2024

I have a very similar issue. I manage to clone, install conda and create the environment in colab. However I can't activate it, the star (*) sign is not even appearing at all. My notebook is here, perhaps someone can take a look.

https://colab.research.google.com/drive/1rGsVd8rbjFXZzqdIw9LnuEJd3z1sgo7H?usp=sharing

I have tried ($) sign, source command, update the base environment (as advised) but none work. stuck there for a couple of days already. help with any trick?

%%bash
source activate nilmtk-env
python
import sys
sys.path.append('/usr/local/lib/nilmtk-env/site-packages')
print(sys.path)
print("python version",sys.version)

from code.

ccruzalegui avatar ccruzalegui commented on May 22, 2024

@guccang did these lines worked for you? Did you try to update the colab notebook? I am trying to confirm after the installation using the line import nilmtk as ntk that currently work on my laptop (I did create this environment in anaconda and running the code using jupyter notebook, but takes forever to train my data). Still no luck on my end :(

https://colab.research.google.com/drive/1rGsVd8rbjFXZzqdIw9LnuEJd3z1sgo7H?usp=sharing

`%%bash
source activate nilmtk-env
python
import sys
sys.path.append('/usr/local/lib/nilmtk-env/site-packages')
print(sys.path)
print("python version",sys.version`

from code.

efanhome avatar efanhome commented on May 22, 2024

This works for me. !source activate myenv && python -m spacy download en_core_web_sm

And you should add " !source activate myenv && " to every command you're going to call

worked for me too. but how can I run python snippet code directly in colab ?

from code.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.