[英]How can I install a Third-Party Package in Python Canopy?
I am currently attempting to install a third-party package (gnuradio, to be specific) into the Canopy version of Python on an Ubuntu computer. 我目前正在尝试在Ubuntu计算机上将第三方软件包(具体来说是gnuradio)安装到Python的Canopy版本中。 I currently have the entire package stored in my filesystem as a folder with subfolders and python files;
目前,我将整个软件包作为一个包含子文件夹和python文件的文件夹存储在文件系统中; however, I have been able to find no information as to how to make the transition into a functionally installed and recognized package.
但是,我找不到任何有关如何过渡到功能已安装且可以识别的软件包的信息。 How can I do so?
我该怎么办?
You shouldn't use third party pythons on Ubuntu, unless you very exactly know what you're doing (you don't). 您不应该在Ubuntu上使用第三方python,除非您完全知道自己在做什么(不这样做)。 Ubuntu keeps your python up-to-date and uses the package manager to install pack
Ubuntu使您的python更新,并使用包管理器安装包
So, setting up a recent version of python is just 因此,设置最新版本的python仅仅是
sudo apt-get install python
So if you still want to integrate GNU Radio into your canopy installation, you will need to get the development headers of exactly their version of python, and specify that you want to only use them etc, and build GNU Radio from source. 因此,如果您仍然希望将GNU Radio集成到您的机盖安装中,则需要获取确切版本的python的开发标头,并指定仅使用它们等,然后从源代码构建GNU Radio。 I do not recommend doing that.
我不建议这样做。
In my opinion, you should probably rather install GNU Radio either from source against the python and libraries on your main OS rather than canopy's happy little installation folder, or use the gnuradio package that Ubuntu has. 在我看来,您应该宁愿从源代码针对主要操作系统上的python和库安装GNU Radio,而不要使用Canopy的快乐小安装文件夹,或者使用Ubuntu拥有的gnuradio软件包。
I recommend using pybombs to install GNU Radio from source. 我建议使用pybombs从源代码安装GNU Radio。 You'll get the latest and greatest, in a safe install prefix, and easy access to bleeding edge SDR device drivers.
使用安全的安装前缀,您将获得最新,最好的产品,并且可以轻松访问最新的SDR设备驱动程序。
(1) Python packaging is inconsistent, but in general, it suffices to type python setup.py install
from the package's top directory (see https://docs.python.org/2/install/#the-new-standard-distutils ) (1)Python打包是不一致的,但是一般来说,从软件包的顶层目录键入
python setup.py install
就足够了(请参阅https://docs.python.org/2/install/#the-new-standard-distutils )
(2) How to be sure that you are installing into Canopy Python rather than your system Python? (2)如何确定要安装到Canopy Python中而不是系统Python中? See https://support.enthought.com/entries/23389761-Installing-packages-into-Canopy-Python-from-the-command-line (tl;dr open a Canopy Terminal window from the Canopy Tools menu.)
请参阅https://support.enthought.com/entries/23389761-Installing-packages-into-Canopy-Python-from-the-commandline(tl ;从Canopy Tools菜单中打开Canopy Terminal窗口。)
EDIT: Marcus Müller has clarified below that gnuradio is not a python package, so this general advice is true but irrelevant. 编辑:马库斯·穆勒(MarcusMüller)在下面澄清了gnuradio不是python软件包,因此,此一般建议是正确的,但无关紧要。 See his answer below.
请参阅下面的答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.