问题
I would like to create a copy of a package on github that I can edit and use in spyder. I currently use the anaconda package manager for my python packages.
Here are the steps that I have taken so far:
- fork repo
- clone repo onto my local directory
The package is called 'Nilearn'. I currently use anaconda and have installed nilearn via 'conda install nilearn'.
I would like to be able to use my own copy of nilearn inside spyder alongside nilearn. I have tried renamine the repo to nilearn_copy, but this doesn't appear to work.
If this is not possible or not the ideal solution, then please help suggest an alternative, I'm new to github and python.
Thanks a lot, Joe
回答1:
You need to open an IPython console, then run this command
In [1]: %cd /path/to/nilearn/parent
By this I mean that you to go with the %cd
magic to the parent directory where nilearn
is placed. After that you can run
In [2]: import nilearn
and that should import your local copy of nilearn
.
Note: If you are planning to do changes to nilearn
and want your changes to be picked up in the same console, you need to run these commands before the previous ones:
In [3]: %load_ext autoreload
In [4]: %autoreload 2
来源:https://stackoverflow.com/questions/43889547/cloning-a-package-from-github-and-use-in-spyder