Install Python packages - SMOTE and codecarbon

Solved!
nsrishan
Level 2
Install Python packages - SMOTE and codecarbon

Hello,

I am trying to use codecarbon and SMOTE on my dataset through my own Python code. What would be the best way to install them?

 

0 Kudos
1 Solution
Turribeach

Yes, when you create the Jupyter Notebook you have to specify the correct Python code environment (ie the one you got the new packages installed). Alternatively you can change the code environment from the Notebook itself by doing Kernel => Change Kernel. It is advisable that you set the code environment at the project settings (three dots => Settings => Code env selection) so that all your Python code recipes and notebooks default to the correct code env.

View solution in original post

0 Kudos
5 Replies
nsrishan
Level 2
Author

Thank you. Is there a video for how to do this? I'm not sure where to go after creating the new python environment. 

0 Kudos
Turribeach

Go to the Code Environment, on the left select "Packages to Install". On the Requested packages box type all the package names you want, one for each line. You can use version numbers if you know what version you want otherwise just use the package name. For example:

cash==2.0.0

Then click on Save and Update and the package should be installed. If there is an error the install log screen will remain visible, if no error it will dissapear. You can confirm the installation on the Currently installed packages on the left.

nsrishan
Level 2
Author

Thank you! One more question, when I run my recipe, everything seems to be working fine. However, if I switch over to the jupyter notebook, I am getting an error again about the packages not existing. Is there anything I should be doing after installing them in the environment?

0 Kudos
Turribeach

Yes, when you create the Jupyter Notebook you have to specify the correct Python code environment (ie the one you got the new packages installed). Alternatively you can change the code environment from the Notebook itself by doing Kernel => Change Kernel. It is advisable that you set the code environment at the project settings (three dots => Settings => Code env selection) so that all your Python code recipes and notebooks default to the correct code env.

0 Kudos