Conda environment | Creating requirements.txt | resolving basic errors

Analytics with Ashish Tripathi
Analytics with Ashish Tripathi
7.8 هزار بار بازدید - 3 سال پیش - This is a basic tutorial
This is a basic tutorial to help you with creating new conda environment and installing packages from the existing environment.
Creating new environment
python --version
conda create --name deeplearning python=3.7.6
conda activate deeplearning

Adding conda environment to jupyter notebook
1. Activate the environment
2. install the ipykernel
conda install -c anaconda ipykernel

3. Add the name to the jupyter notebook
python -m ipykernel install --user --name deeplearning --display-name "deeplearning"

4. To see all the kernels in jupyter notebook
jupyter kernelspec list

5. To delete any kernel
jupyter kernelspec uninstall old-env

If you get an error on opening the new kernel - ImportError: DLL load failed: The specified module could not be found.
Solution - Open command prompt,
activate root
activate deeplearning
Jupyter notebook

Creating the requirements.txt
1. Create the requirements.txt from existing environment
2. conda list -e angle bracket requirements.txt
Problem with this giving only one equal sign instead of two, which is not correct.

Similarly pip freeze angle bracket requirements.txt giving some extra lines which result into error

Solution is:
To get the correct formated requirements.txt us this command
pip list --format=freeze angle bracket requirements.txt

to install all from txt file use this
pip install -r requirements.txt
3 سال پیش در تاریخ 1400/03/21 منتشر شده است.
7,870 بـار بازدید شده
... بیشتر