本文介绍了从github克隆一个软件包并在spyder中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在github上创建一个软件包的副本,我可以在spyder中对其进行编辑和使用.我目前将anaconda软件包管理器用于我的python软件包.

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. 叉库
  2. 将存储库克隆到我的本地目录

该程序包称为"Nilearn".我目前正在使用anaconda,并已通过"conda install nilearn"安装了nilearn.

The package is called 'Nilearn'. I currently use anaconda and have installed nilearn via 'conda install nilearn'.

我希望能够在spyder中与nilearn一起使用自己的nilearn副本.我已经尝试过将胺胺重新购回nilearn_copy,但这似乎行不通.

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.

如果这不可能或不是理想的解决方案,那么请帮忙提出一个替代方案,我是github和python的新手.

If this is not possible or not the ideal solution, then please help suggest an alternative, I'm new to github and python.

非常感谢,乔

推荐答案

您需要打开IPython控制台,然后运行此命令

You need to open an IPython console, then run this command

In [1]: %cd /path/to/nilearn/parent

这是指您将%cd 魔术放到放置 nilearn 的父目录中.之后,您可以运行

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

,并且应该导入 nilearn 的本地副本.

and that should import your local copy of nilearn.

注意:如果您打算对 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

这篇关于从github克隆一个软件包并在spyder中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 20:15