简体   繁体   English

无法使用 setup.py 安装包

[英]Unable to install package using setup.py

I tried to install a python package using setup.py but failed.我尝试使用 setup.py 安装 python 包但失败了。

Any idea about that?对此有什么想法吗? I am on Ubuntu 14.04.我在 Ubuntu 14.04 上。

pip install setup.py

错误

You just mixed up something.Have a look at pip install usage and Installing Python Modules .你只是混淆了一些东西。看看pip install usageInstalling Python Modules

If you want to download a module source distribution and install it, you should unpack the archive into a similarly-named directory: foo-1.0 .如果你想下载模块源代码分发并安装它,你应该将存档解压到一个类似名称的目录中: foo-1.0 Additionally, the distribution will contain a setup script setup.py ,and then run this command from a terminal:此外,发行版将包含安装脚本setup.py ,然后从终端运行此命令:

python setup.py install

You can use pip install if you want to install packages from:如果要从以下位置安装软件包,可以使用pip install

  • PyPI (and other indexes) using requirement specifiers.使用需求说明符的 PyPI(和其他索引)。
  • VCS project urls. VCS 项目 url。
  • Local project directories.本地项目目录。
  • Local or remote source archives.本地或远程源存档。

Hope this helps.希望这可以帮助。

Use the following:使用以下内容:

python setup.py install

Try this python setup.py install试试这个python setup.py install

Navigate to the folder containing the package导航到包含包的文件夹

eg: cd /Desktop/packages/foo-1.0/

you can install the package either by您可以通过以下方式安装软件包

python setup.py install  

or by或通过

pip install ./

in Linux use在 Linux 中使用

sudo python3 setup.py install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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