简体   繁体   English

Ubuntu上的Python 3.6和pip安装错误

[英]Python 3.6 and pip install errors on Ubuntu

I'm trying to install scikit using python3.6 on Ubuntu 16.04 and cannot seem to get pip to work properly. 我正在尝试在Ubuntu 16.04上使用python3.6安装scikit,似乎无法使pip正常工作。

I installed pip3 by running sudo apt-get install python3-pip 我通过运行sudo apt-get install python3-pip安装了pip3

That throws an error saying 抛出一个错误的说法

pip3 install scikit
Failed to import the site module
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site.py", line 73, in <module>
    import os
  File "/usr/local/lib/python3.6/os.py", line 652, in <module>
    from _collections_abc import MutableMapping
  File "/usr/local/lib/python3.6/_collections_abc.py", line 64
    async def _ag(): yield
                    ^
SyntaxError: 'yield' inside async function

If I try to just run pip I get this 如果我试着跑点子,我会得到这个

  pip
  File "/usr/local/lib/python3.6/site.py", line 177
    file=sys.stderr)
        ^
  SyntaxError: invalid syntax

I'm new to python and stackoverflow so any help would be appreciated. 我是python和stackoverflow的新手,所以任何帮助将不胜感激。

Try installing the one recommended on Pypi 尝试安装推荐的Pypi

pip3 install scikit-learn

And if that doesn't work just download the package from here 如果不起作用,请从此处下载软件包

https://pypi.python.org/pypi/scikit-learn/0.15.2 https://pypi.python.org/pypi/scikit-learn/0.15.2

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

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