简体   繁体   English

Python3模块安装

[英]Python3 module Installation

I'm trying to install the module aiohttp for python so I can set up a system for downloading files with uvloop. 我正在尝试为python安装模块aiohttp,所以我可以设置一个系统来使用uvloop下载文件。 I'm having some difficulty, though, when I go into my folder which I extracted aiohttp to and doing the following commands: 但是,当我进入将aiohttp解压缩到的文件夹并执行以下命令时,遇到了一些困难:

sudo python3 setup.py install
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    from setuptools import setup, Extension
ImportError: No module named 'setuptools'

I looked around and saw that some people had this problem but it was fixed by getting the python-setuptools or python3-setuptools package. 我环顾四周,发现有些人遇到了这个问题,但是通过获取python-setuptools或python3-setuptools软件包已解决了该问题。 So I tried to do that but this is the output I get: 所以我尝试这样做,但这是我得到的输出:

$ sudo apt-get install python3-setuptools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-setuptools is already the newest version.
python3-setuptools set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

$ sudo apt-get install python-setuptools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-setuptools is already the newest version.
python-setuptools set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Which leads me to believe that python-setuptools is already installed! 这使我相信python-setuptools已经安装! I'm not sure where to go from here. 我不确定从这里去哪里。 Just for clarity, I did try 为了清楚起见,我确实尝试过

sudo python setup.py install

but I received an error because Python 3.4.1+ is needed to install aiohttp: 但是我收到一个错误,因为安装aiohttp需要Python 3.4.1+:

sudo python setup.py install
Traceback (most recent call last):
  File "setup.py", line 61, in <module>
    raise RuntimeError("aiohttp requires Python 3.4.1+")
RuntimeError: aiohttp requires Python 3.4.1+

I'm running Linux Mint 17.2 Qiana on an HP Elitebook 8440p. 我在HP Elitebook 8440p上运行Linux Mint 17.2 Qiana。 Any suggestions as to what I should do? 关于我应该做什么的建议? Thanks in advance! 提前致谢!

First Install python3 首先安装python3

brew install python3 && cp /usr/local/bin/python3 /usr/local/bin/python

Then use pip3 to install aiohttp 然后使用pip3安装aiohttp

pip3 install aiohttp

sudo dnf install python-devel-2.7.12-6.fc24.x86_64解决了我的问题

对我来说,在Mac笔记本电脑上安装uvloop可以正常工作:

  pip install uvloop

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

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