- Module Code: COMP 20039
- Academic Year: Spring 2024
You can choose to install the packages in your global Python environment, or within a virtual environment. It is recommended to use a virtual environment to avoid conflicts with other projects.
- If you don't have Python3 installed, please install it from the official website: Python3
- You can also install Python3 using Homebrew:
brew install python3
- You can install Jupyter Notebook using pip:
pip3 install jupyterlab
- You can install the required packages using pip:
pip3 install numpy pandas
- You can create a virtual environment and install the packages using the following commands:
python3 -m venv {path_to_venv} # Create a virtual environment
source {path_to_venv}/bin/activate # Activate the virtual environment
pip3 install {package_name} # Install the package
- Please replace
{package_name}
with the name of the package you're trying to install, and{path_to_venv}
with the path where you want to create your virtual environment.
- You can also install the required packages using a requirements file. You can create a requirements file by running the following command:
pip3 freeze > requirements.txt
- You can then install the packages using the following command:
pip3 install -r requirements.txt
-
You can install Conda by following the instructions on the official website: Conda Conda
-
You can also install Conda using Homebrew:
brew install conda
- You can also install Conda using pip:
pip3 install conda
- You can create a Conda environment and install the packages using the following commands:
conda create --name {env_name} python={version} # Create a Conda environment
conda activate {env_name} # Activate the Conda environment
conda install {package_name} # Install the package
-
Please replace
{env_name}
with the name of the Conda environment you're trying to create,{version}
with the version of Python you want to use, and{package_name}
with the name of the package you're trying to install.- I've created a conda environment file called
pyEnv
which contains the required packages for this project. - Installed the required packages using the following command:
- I've created a conda environment file called
-
Navigate to the directory where the your project is created and run the following commands:
conda env create -n pyEnv python
conda activate pyEnv
conda install numpy pandas jupyter
- If you faced any issues with the above command, you can install the packages using the following command:
conda install -c conda-forge numpy pandas jupyter
- You can also install the required packages using a Conda environment file. You can create a Conda environment file by running the following command:
conda env export > environment.yml
- You can then install the packages using the following command:
conda env create -f environment.yml
- You can create it by pressing
Ctrl + Shift + P
and typingJupyter: Create New Blank Notebook
and pressEnter
.
The above steps will help you set up a Python virtual environment and install the required packages in VS Code. You can then start writing your code in a Jupyter Notebook and run the code to see the output.
/pyEnv/bin* /pyEnv/etc* /pyEnv/include* /pyEnv/lib* /pyEnv/share*
Conda Documentation — conda 24.1.2 documentation. (n.d.). Retrieved from https://docs.conda.io/en/latest/