简体   繁体   中英

Cloning a package from github and use in spyder

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:

  1. fork repo
  2. 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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM