Anaconda SciPy Dev: Part II (macOS)

Опубликовано: 27 Май 2025
на канале: Matt Haberland
323
1

This video shows how to use a virtual environment to easily switch between the "pre-built version" of SciPy and a "source-built version" of SciPy created according to Anaconda SciPy Dev: Part I.

Note: The whole procedure from 0:38 to 1:38 of the video can be replaced by entering:
conda develop /scipy
into the console after installing SciPy's build dependencies, where "scipy" is the root directory of the development version of SciPy (e.g. /Users/myusername/Desktop/scipydev/scipy).

Virtual environments allow you to switch among effectively separate Python installations on the same computer. We will create a virtual environment called "scipydev" that does not have a pre-built version of SciPy installed. Instead, it will have our source-built version of SciPy on the Python path. When this virtual environment is activated, any changes made to the SciPy source code (cloned from git on the Desktop) will be reflected when we `import scipy`. This will allow you to easily modify source code and test your changes. Furthermore, as I'll demonstrate in a future video, the source code you are modifying is managed by git, so you can easily push these changes to your GitHub repository and submit a pull request.

Reverting to the pre-built version of SciPy (for doing other work unrelated to SciPy development) is as easy as deactivating the virtual environment.

We'll also make two desktop icons for Spyder. One will activates the "scipydev" virtual environment open Spyder; this is the one you'd use to do SciPy development work. The other that simply opens Spyder without the virtual environment activated; this is the one you'd use for doing work unrelated to SciPy development.