如何在Anaconda中安装软件包? [英] How to install package in anaconda?

查看:908
本文介绍了如何在Anaconda中安装软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将音乐包添加到anaconda解释器中. 我正在使用ubuntu 14.04 64位. 我从anaconda云下载了music21-1.9.3.tar.gz. 我将其解压缩到anaconda3/pkgs

I want to add music package to anaconda interpreter. I'm using ubuntu 14.04 64bit. I downloaded music21-1.9.3.tar.gz from anaconda cloud. I unpacked it to anaconda3/pkgs

ext                installer.py  music21           PKG-INFO   setup.cfg
installer.command  MANIFEST.in   music21.egg-info  README.md  setup.py

我在网上找不到任何东西,或者无法正常工作.如何安装?

I found nothing on the web, or doesn't work. How can I install it?

推荐答案

您是否正在使用Windows?如果是这样,请打开命令提示符"窗口.

Are you using Windows? If so, open up a Command Prompt window.

我想做的是复制我要安装的软件包的链接地址.在这种情况下,一个简单的Google搜索将我带到了一个受欢迎的python软件包站点: https://pypi.python.org/pypi/music21/1.9.3

What I like to do is Copy the Link Address of the package that I would like to install. In this case, a simple google search lead me to a popular python package site : https://pypi.python.org/pypi/music21/1.9.3

我右键单击tar.gz超链接,然后单击复制链接地址"以获取此信息:

I right-click the tar.gz hyperlink and click "Copy Link Address" to get this : https://pypi.python.org/packages/source/m/music21/music21-1.9.3.tar.gz#md5=d271e4a8c60cfa634796fc81d1278eaf

现在要安装它,在命令提示符窗口中,输入以下内容:

Now to install this, in your command prompt window, type the following :

pip install https://pypi.python.org/packages/source/m/music21/music21-1.9.3.tar.gz#md5=d271e4a8c60cfa634796fc81d1278eaf

conda install https://pypi.python.org/packages/source/m/music21/music21-1.9.3.tar.gz#md5=d271e4a8c60cfa634796fc81d1278eaf

它应该自动从该链接地址下载该软件包,解压缩,然后尝试将其安装在您的python环境中.

And it should automatically download the package from that link address, unzip it, and then attempt to install it in your python environment.

很高兴知道如何手动安装python软件包,以及那些不易于跨平台自动安装的发行版.

It's good to know how to install python packages manually as well for distributions that don't lend themselves as easily to cross-platform auto-installations.

您要做的是将tar.gz文件(或任何其他压缩的包文件)解压缩,直到拥有带有"setup.py"文件名的文件夹目录为止.您将进入命令提示符窗口,然后"cd"进入该目录.

What you would do is unzip the tar.gz file ( or any other compressed package file ) until you have a folder directory with a "setup.py" file name. You would go into your command prompt window and "cd" into that directory.

然后,您将通过键入"python"来调用Python Executable,这将使命令提示符知道您正在调用python来运行命令并完成该行,因此总的来说,像这样:

Then you would call the Python Executable by typing "python" which lets the command prompt know that you are calling python to run your command and finish the line so in total it looks like this :

python setup.py install 

那里有.

这篇关于如何在Anaconda中安装软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆