本文共 7999 字,大约阅读时间需要 26 分钟。
大致报错如下:
Running setup.py install for mysqlclient ... error ERROR: Command errored out with exit status 1: command: /home/kai/python/env/djangoblog/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-d07knlry/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-d07knlry/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-mkay836m/install-record.txt --single-version-externally-managed --compile --install-headers /home/kai/python/env/djangoblog/include/site/python3.6/mysqlclient cwd: /tmp/pip-install-d07knlry/mysqlclient/ Complete output (33 lines): /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) running install running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb creating build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants running build_ext building 'MySQLdb._mysql' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/MySQLdb x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 -I/usr/include/mysql -I/usr/include/python3.6m -I/home/kai/python/env/djangoblog/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so /usr/bin/ld: cannot find -lssl /usr/bin/ld: cannot find -lcrypto collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ----------------------------------------ERROR: Command errored out with exit status 1: /home/kai/python/env/djangoblog/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-d07knlry/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-d07knlry/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-mkay836m/install-record.txt --single-version-externally-managed --compile --install-headers /home/kai/python/env/djangoblog/include/site/python3.6/mysqlclient Check the logs for full command output.
解决办法:
报错如下:
ERROR: Command errored out with exit status 1: command: /home/kai/python/env/djangoblog/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kzmacki4/django-haystack/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kzmacki4/django-haystack/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-install-kzmacki4/django-haystack/pip-egg-info cwd: /tmp/pip-install-kzmacki4/django-haystack/ Complete output (33 lines): WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.douban.com'. ERROR: Could not find a version that satisfies the requirement setuptools_scm (from versions: none) ERROR: No matching distribution found for setuptools_scm Traceback (most recent call last): File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/setuptools/installer.py", line 119, in fetch_build_egg subprocess.check_call(cmd) File "/usr/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/kai/python/env/djangoblog/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpobxct58l', '--quiet', 'setuptools_scm']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-kzmacki4/django-haystack/setup.py", line 71, in setup_requires=['setuptools_scm'], File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup _install_setup_requires(attrs) File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires) File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/setuptools/dist.py", line 721, in fetch_build_eggs replace_conflicting=True, File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/pkg_resources/__init__.py", line 782, in resolve replace_conflicting=replace_conflicting File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1065, in best_match return self.obtain(req, installer) File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1077, in obtain return installer(requirement) File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/setuptools/dist.py", line 777, in fetch_build_egg return fetch_build_egg(self, req) File "/home/kai/python/env/djangoblog/lib/python3.6/site-packages/setuptools/installer.py", line 121, in fetch_build_egg raise DistutilsError(str(e)) distutils.errors.DistutilsError: Command '['/home/kai/python/env/djangoblog/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpobxct58l', '--quiet', 'setuptools_scm']' returned non-zero exit status 1. ----------------------------------------ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
解决办法:
解决办法:
解决办法:
转载地址:http://jzkrn.baihongyu.com/