Cloning a package from github and use in spyder

三世轮回 提交于 2021-02-19 07:57:09

问题


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


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!