python2.7 sklearn装不上
$ pip install sklearn
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/, https://pypi.tuna.tsinghua.edu.cn/simple
Collecting sklearnUsing cached https://mirrors.aliyun.com/pypi/packages/1e/7a/dbb3be0ce9bd5c8b7e3d87328e79063f8b263b2b1bfa4774cb1147bfcd3f/sklearn-0.0.tar.gz (1.1 kB)ERROR: Command errored out with exit status 1:command: /home/user1/miniconda3/envs/hardsample/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-XLSfhS/sklearn/setup.py'"'"'; __file__='"'"'/tmp/pip-install-XLSfhS/sklearn/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-4HSdD9cwd: /tmp/pip-install-XLSfhS/sklearn/Complete output (10 lines):Traceback (most recent call last):File "<string>", line 1, in <module>File "/home/user1/miniconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 16, in <module>import setuptools.versionFile "/home/user1/miniconda3/lib/python3.7/site-packages/setuptools/version.py", line 1, in <module>import pkg_resourcesFile "/home/user1/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1365raise SyntaxError(e) from e^SyntaxError: invalid syntax----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
改用conda install试试。