简体   繁体   English

没有名为 setuptools 的模块

[英]No module named setuptools

I want to install setup file of twilio.我想安装 twilio 的安装文件。 When I install it through given command it is given me an error:当我通过给定的命令安装它时,它给了我一个错误:

No module named setuptools.没有名为 setuptools 的模块。

Could you please let me know what should I do?你能告诉我我该怎么做吗?

I am using python 2.7我正在使用python 2.7

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Python27>python D:\test\twilio-twilio-python-26f6707\setup.py install
Traceback (most recent call last):
  File "D:\test\twilio-twilio-python-26f6707\setup.py", line 2, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools

Install setuptools and try again.安装setuptools试。

try command:尝试命令:

sudo apt-get install -y python-setuptools

For ubuntu users, this error may arise because setuptool is not installed system-wide.对于 ubuntu 用户,可能会出现此错误,因为 setuptool 未在系统范围内安装。 Simply install setuptool using the command:只需使用以下命令安装 setuptool:

sudo apt-get install -y python-setuptools

For python3:对于python3:

sudo apt-get install -y python3-setuptools

After that, install your package again normally, using之后,再次正常安装您的软件包,使用

sudo python setup.py install

That's all.就这样。

For Python Run This Command对于 Python 运行此命令

apt-get install -y python-setuptools

For Python 3.对于 Python 3。

apt-get install -y python3-setuptools

The PyPA recommended tool for installing and managing Python packages is pip . PyPA 推荐的用于安装和管理 Python 包的工具是pip pip is included with Python 3.4 ( PEP 453 ), but for older versions here's how to install it (on Windows, using Python 3.3): pip包含在 Python 3.4 ( PEP 453 ) 中,但对于旧版本,这里是如何安装它(在 Windows 上,使用 Python 3.3):

Download https://bootstrap.pypa.io/get-pip.py下载https://bootstrap.pypa.io/get-pip.py

>c:\Python33\python.exe get-pip.py
Downloading/unpacking pip
Downloading/unpacking setuptools
Installing collected packages: pip, setuptools
Successfully installed pip setuptools
Cleaning up...

Sample usage:示例用法:

>c:\Python33\Scripts\pip.exe install pymysql
Downloading/unpacking pymysql
Installing collected packages: pymysql
Successfully installed pymysql
Cleaning up...

In your case it would be this (it appears that pip caches independent of Python version):在你的情况下是这样的(看起来pip缓存独立于 Python 版本):

C:\Python27>python.exe \code\Python\get-pip.py
Requirement already up-to-date: pip in c:\python27\lib\site-packages
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |################################| 69kB 255kB/s
Installing collected packages: wheel
Successfully installed wheel-0.29.0

C:\Python27>cd Scripts

C:\Python27\Scripts>pip install twilio
Collecting twilio
  Using cached twilio-5.3.0.tar.gz
Collecting httplib2>=0.7 (from twilio)
  Using cached httplib2-0.9.2.tar.gz
Collecting six (from twilio)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting pytz (from twilio)
  Using cached pytz-2015.7-py2.py3-none-any.whl
Building wheels for collected packages: twilio, httplib2
  Running setup.py bdist_wheel for twilio ... done
  Stored in directory: C:\Users\Cees.Timmerman\AppData\Local\pip\Cache\wheels\e0\f2\a7\c57f6d153c440b93bd24c1243123f276dcacbf43cc43b7f906
  Running setup.py bdist_wheel for httplib2 ... done
  Stored in directory: C:\Users\Cees.Timmerman\AppData\Local\pip\Cache\wheels\e1\a3\05\e66aad1380335ee0a823c8f1b9006efa577236a24b3cb1eade
Successfully built twilio httplib2
Installing collected packages: httplib2, six, pytz, twilio
Successfully installed httplib2-0.9.2 pytz-2015.7 six-1.10.0 twilio-5.3.0

对于python3是:

sudo apt-get install -y python3-setuptools

这个问题提到了 Windows,接受的答案也适用于 Ubuntu,但对于那些发现这个问题来自 Redhat 风格的 Linux 的人来说,这解决了问题:

sudo yum install -y python-setuptools

Install Specific Version:安装特定版本:

pip install python-setuptools

Upgrade python-setuptools升级 python-setuptools

sudo pip3 install --upgrade python-setuptools

Getting Dependency Error in Window 10 Use code: easy_install instead of pip install在 Window 10 中出现依赖错误 使用代码:easy_install 而不是 pip install

easy_install python-setuptools 

Upgrade using easy install使用简易安装升级

sudo easy_install --upgrade  python-setuptools

On OSX System to install Module: Use code: brew install instead of pip install在 OSX 系统上安装模块:使用代码:brew install 而不是 pip install

brew install python-setuptools 

Without Using Pip :不使用 Pip :

 sudo apt-get install -y python-setuptools 

On CentOS7 or Linux Fedora:在 CentOS7 或 Linux Fedora 上:

yum -y install python-setuptools 

Or on Fedora try或者在 Fedora 上试试

sudo dnf install python-setuptools 

Command if Homebrew screws up your path on macOS:如果 Homebrew 在 macOS 上搞砸了你的路径,则命令:

python -m pip install python-setuptools 

For Python3 MacOs Homebrew screws对于 Python3 MacOs Homebrew 螺丝

python3 -m pip install python-setuptools

Verify module from list MacOs从列表 MacO 验证模块

pip freeze | grep  python-setuptools

For Execute on Anaconda as your python package manager在 Anaconda 上作为你的 python 包管理器执行

 conda install -c anaconda python-setuptools 

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

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