This is a mostly GUI-based approach to install and develop a Python package that should be particularly convenient for Windows users.
- Set up a Python environment by installing Anaconda and using the Anaconda Navigator. Set up an environment using a supported version of Python for the package you wish to install.
- Using the Anaconda Navigator, go to Home and install Spyder into the environment.
- Mac: In Anaconda Navigator, go to Environments and click on the green/white arrow and select Open Terminal Windows: Access the Anaconda Prompt
- Windows: You may have to implement this fix for the
conda installcommands below to work. - In the terminal, make sure that the environment is activated. If it is not, you can activate it:
conda activate your_environment_name - Install Spyder Notebook into the environment:
conda install spyder-notebook -c conda-forge - Install Spyder Terminal into the environment:
conda install spyder-terminal -c conda-forge - Go to Home and Launch Spyder in the environment.
- Set the working directory in Spyder to the code repository. With this set, you can click on the Files tab to view the files and directories in the code repository.
- Select the Terminal tab and activate the environment:
conda activate your_environment_name - Install the package into the environment using pip:
pip install -e . - If the package has installed successfully you will be able to import package_name in the iPython Console. If this does not work, close Spyder, relaunch Spyder, and try to import package_name in the iPython Console again.
- Open a Notebook from the code repository using the Notebook tab and clicking the three dots in the top right of the panel.
- Once the notebook has loaded, if the text in the top right reads Not Trusted, click on this text and then Trust.