setuptools和pip安装报错

来源:2-4 Python等基础环境安装

了不了之

2022-02-05

toolroot@192:/usr/local/src/setuptools-28.8.0# /opt/python2.7/bin/python ./setup.py install
Traceback (most recent call last):
File “./setup.py”, line 11, in
import setuptools
File “/usr/local/src/setuptools-28.8.0/setuptools/init.py”, line 10, in
from setuptools.extern.six.moves import filter, filterfalse, map
File “/usr/local/src/setuptools-28.8.0/setuptools/extern/init.py”, line 1, in
from pkg_resources.extern import VendorImporter
File “/usr/local/src/setuptools-28.8.0/pkg_resources/init.py”, line 36, in
import email.parser
File “/opt/python2.7/lib/python2.7/email/parser.py”, line 12, in
from email.feedparser import FeedParser
File “/opt/python2.7/lib/python2.7/email/feedparser.py”, line 27, in
from email import message
File “/opt/python2.7/lib/python2.7/email/message.py”, line 16, in
import email.charset
File “/opt/python2.7/lib/python2.7/email/charset.py”, line 13, in
import email.base64mime
File “/opt/python2.7/lib/python2.7/email/base64mime.py”, line 40, in
from email.utils import fix_eols
File “/opt/python2.7/lib/python2.7/email/utils.py”, line 27, in
import random
File “/opt/python2.7/lib/python2.7/random.py”, line 49, in
import hashlib as _hashlib
File “/opt/python2.7/lib/python2.7/hashlib.py”, line 136, in
globals()[__func_name] = __get_hash(__func_name)
File “/opt/python2.7/lib/python2.7/hashlib.py”, line 74, in __get_builtin_constructor
import _sha256
ImportError: No module named _sha256
root@192:/usr/local/src/setuptools-28.8.0# /opt/python2.7/bin/pip install -r ./requirements.txt
-bash: /opt/python2.7/bin/pip: No such file or directory

写回答

1回答

Jeson

2022-03-01

看看这个错误,ImportError: No module named _sha256

另外pip 也没有安装上,可以尝试如下方式:

wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz
tar -zxvf pip-9.0.1.tar.gz
cd pip-9.0.1
python setup.py install



0
0

Python+Django+Ansible Playbook自动化运维项目实战

【课程升级3.6版本】大牛全面践行DevOps,运维与开发间高效协作

861 学习 · 326 问题

查看课程