DEV Community

hub
hub

Posted on

1

how to use Python virtual environments with conda - some notes

how to use Python virtual environments with conda, you can follow these steps:

Open your terminal or Anaconda prompt.

Create a new conda environment by typing the following command:

conda create --name env_name python=X.X

Replace env_name with the name you want to give to your environment and X.X with the version of Python you want to use. For example, to create an environment called my_env with Python 3.9, you would type:

conda create --name my_env python=3.9

Activate the environment by typing:

conda activate env_name

Replace env_name with the name of your environment. For example, to activate the my_env environment, you would type:

conda activate my_env

Install any packages you need for your project using conda install. For example, to install the pandas package, you would type:

conda install pandas

When you're finished working in the environment, you can deactivate it by typing:

conda deactivate

This will return you to your default system Python installation.

To delete the environment, you can use the following command:

conda env remove --name env_name

Replace env_name with the name of the environment you want to delete. For example, to delete the my_env environment, you would type:

conda env remove --name my_env

That's it! Using conda with Python virtual environments is a great way to keep your project dependencies organized and isolated.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay