我在以非root用户身份登录时在virtualenv中安装lxml和scrapy时遇到问题。以root用户身份登录时,安装对于相同的环境可以正常工作。
我遵循的步骤如下:
以非root用户身份登录
virtualenv -p python3 test
cd test
source bin/activate
pip install lxml
给出:
Collecting lxml
Using cached lxml-4.1.1.tar.gz
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml ... error
Complete output from command /home/intellinked/projects/test2/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-cci6wo0_/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmprzv4hx5epip-wheel- --python-tag cp37:
Building lxml version 4.1.1.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib64
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-3.7/lxml
copying src/lxml/_elementpath.py -> build/lib.linux-x86_64-3.7/lxml
copying src/lxml/sax.py -> build/lib.linux-x86_64-3.7/lxml
[truncated]
copying src/lxml/includes/etree_defs.h -> build/lib.linux-x86_64-3.7/lxml/includes
creating build/lib.linux-x86_64-3.7/lxml/isoschematron/resources
creating build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/rng
creating build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl
creating build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
creating build/temp.linux-x86_64-3.7/src/lxml
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DCYTHON_CLINE_IN_TRACEBACK=1 -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/usr/local/include/python3.7m -c src/lxml/etree.c -o build/temp.linux-x86_64-3.7/src/lxml/etree.o -w
unable to execute 'gcc': Permission denied
Compile failed: command 'gcc' failed with exit status 1
creating tmp
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitk8cdu1xy.c -o tmp/xmlXPathInitk8cdu1xy.o
unable to execute 'cc': Permission denied
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command /home/intellinked/projects/test2/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-cci6wo0_/lxml/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-cm8mq44i-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/intellinked/projects/test2/include/site/python3.7/lxml:
Building lxml version 4.1.1.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib64
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.linux-x86_64-3.7/lxml
[some more copying lines here]
running build_ext
building 'lxml.etree' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
creating build/temp.linux-x86_64-3.7/src/lxml
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DCYTHON_CLINE_IN_TRACEBACK=1 -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/usr/local/include/python3.7m -c src/lxml/etree.c -o build/temp.linux-x86_64-3.7/src/lxml/etree.o -w
unable to execute 'gcc': Permission denied
Compile failed: command 'gcc' failed with exit status 1
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit4jxbujda.c -o tmp/xmlXPathInit4jxbujda.o
unable to execute 'cc': Permission denied
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/intellinked/projects/test2/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-cci6wo0_/lxml/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-cm8mq44i-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/intellinked/projects/test2/include/site/python3.7/lxml" failed with error code 1 in /tmp/pip-build-cci6wo0_/lxml/
全局安装了所需的python依赖项:
Package libxslt-devel-1.1.26-2.el6_3.1.x86_64 already installed and latest version
Package zlib-devel-1.2.3-29.el6.x86_64 already installed and latest version
Package libffi-devel-3.0.5-3.2.el6.x86_64 already installed and latest version
Package flex-2.5.35-9.el6.x86_64 already installed and latest version
Package gcc-4.4.7-18.el6.x86_64 already installed and latest version
Package redhat-rpm-config-9.0.3-51.el6.centos.noarch already installed and latest version
Package rpm-build-4.8.0-55.el6.x86_64 already installed and latest version
Package 1:make-3.81-23.el6.x86_64 already installed and latest version
Package patch-2.6-6.el6.x86_64 already installed and latest version
Package 1:pkgconfig-0.23-9.1.el6.x86_64 already installed and latest version
Package gettext-0.17-18.el6.x86_64 already installed and latest version
Package automake-1.11.1-4.el6.noarch already installed and latest version
Package bison-2.4.1-5.el6.x86_64 already installed and latest version
Package libtool-2.2.6-15.5.el6.x86_64 already installed and latest version
Package autoconf-2.63-5.1.el6.noarch already installed and latest version
Package gcc-c++-4.4.7-18.el6.x86_64 already installed and latest version
Package binutils-2.20.51.0.2-5.47.el6_9.1.x86_64 already installed and latest version
Package elfutils-0.164-2.el6.x86_64 already installed and latest version
Package cvs-1.11.23-16.el6.x86_64 already installed and latest version
Package rcs-5.7-37.el6.x86_64 already installed and latest version
Package subversion-1.6.11-15.el6_7.x86_64 already installed and latest version
Package libffi-devel-3.0.5-3.2.el6.x86_64 already installed and latest version
Package python-devel-2.6.6-66.el6_8.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-57.el6.x86_64 already installed and latest version
Package libxml2-devel-2.7.6-21.el6_8.1.x86_64 already installed and latest version
我也尝试过不重新编译lxml依赖项 -
STATIC_DEPS=true pip install lxml
给出(部分截断的输出):
Collecting lxml
Using cached lxml-4.1.1.tar.gz
Complete output from command python setup.py egg_info:
Building lxml version 4.1.1.
Latest version of libxml2 is 2.9.8
Downloading libxml2 into libs/libxml2-2.9.8.tar.gz from ftp://xmlsoft.org/libxml2/libxml2-2.9.8.tar.gz
Traceback (most recent call last):
File "/usr/local/lib/python3.7/urllib/request.py", line 2417, in retrfile
self.ftp.cwd(file)
File "/usr/local/lib/python3.7/ftplib.py", line 631, in cwd
return self.voidcmd(cmd)
File "/usr/local/lib/python3.7/ftplib.py", line 278, in voidcmd
return self.voidresp()
File "/usr/local/lib/python3.7/ftplib.py", line 251, in voidresp
resp = self.getresp()
File "/usr/local/lib/python3.7/ftplib.py", line 246, in getresp
raise error_perm(resp)
ftplib.error_perm: 550 Failed to change directory.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/urllib/request.py", line 1539, in ftp_open
fp, retrlen = fw.retrfile(file, type)
File "/usr/local/lib/python3.7/urllib/request.py", line 2419, in retrfile
raise URLError('ftp error: %r' % reason) from reason
urllib.error.URLError: <urlopen error ftp error: error_perm('550 Failed to change directory.',)>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-waqe8a7a/lxml/setup.py", line 240, in <module>
**setup_extra_options()
File "/tmp/pip-build-waqe8a7a/lxml/setup.py", line 150, in setup_extra_options
STATIC_CFLAGS, STATIC_BINARIES)
File "/tmp/pip-build-waqe8a7a/lxml/setupinfo.py", line 75, in ext_modules
multicore=OPTION_MULTICORE)
File "/tmp/pip-build-waqe8a7a/lxml/buildlibxml.py", line 389, in build_libxml2xslt
libxml2_dir = unpack_tarball(download_libxml2(download_dir, libxml2_version), build_dir)
File "/tmp/pip-build-waqe8a7a/lxml/buildlibxml.py", line 210, in download_libxml2
version_re, filename, version=version)
File "/tmp/pip-build-waqe8a7a/lxml/buildlibxml.py", line 291, in download_library
urlretrieve(full_url, dest_filename)
File "/usr/local/lib/python3.7/urllib/request.py", line 247, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.7/urllib/request.py", line 1550, in ftp_open
raise exc.with_traceback(sys.exc_info()[2])
File "/usr/local/lib/python3.7/urllib/request.py", line 1539, in ftp_open
fp, retrlen = fw.retrfile(file, type)
File "/usr/local/lib/python3.7/urllib/request.py", line 2419, in retrfile
raise URLError('ftp error: %r' % reason) from reason
urllib.error.URLError: <urlopen error ftp error: URLError("ftp error: error_perm('550 Failed to change directory.',)",)>
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-waqe8a7a/lxml
我在尝试安装scrapy时面临类似的问题:
Collecting scrapy
Using cached Scrapy-1.5.0-py2.py3-none-any.whl
Collecting Twisted>=13.1.0 (from scrapy)
Using cached Twisted-17.9.0.tar.bz2
Collecting cssselect>=0.9 (from scrapy)
Using cached cssselect-1.0.3-py2.py3-none-any.whl
Collecting parsel>=1.1 (from scrapy)
Using cached parsel-1.4.0-py2.py3-none-any.whl
Collecting w3lib>=1.17.0 (from scrapy)
Using cached w3lib-1.19.0-py2.py3-none-any.whl
Collecting queuelib (from scrapy)
Using cached queuelib-1.4.2-py2.py3-none-any.whl
Requirement already satisfied: six>=1.5.2 in /usr/local/lib/python3.7/site-packages (from scrapy)
Collecting PyDispatcher>=2.0.5 (from scrapy)
Using cached PyDispatcher-2.0.5.tar.gz
Requirement already satisfied: lxml in ./lib/python3.7/site-packages (from scrapy)
Collecting pyOpenSSL (from scrapy)
Using cached pyOpenSSL-17.5.0-py2.py3-none-any.whl
Collecting service-identity (from scrapy)
Using cached service_identity-17.0.0-py2.py3-none-any.whl
Collecting zope.interface>=4.0.2 (from Twisted>=13.1.0->scrapy)
Using cached zope.interface-4.4.3.tar.gz
Collecting constantly>=15.1 (from Twisted>=13.1.0->scrapy)
Using cached constantly-15.1.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1 (from Twisted>=13.1.0->scrapy)
Using cached incremental-17.5.0-py2.py3-none-any.whl
Collecting Automat>=0.3.0 (from Twisted>=13.1.0->scrapy)
Using cached Automat-0.6.0-py2.py3-none-any.whl
Collecting hyperlink>=17.1.1 (from Twisted>=13.1.0->scrapy)
Using cached hyperlink-17.3.1-py2.py3-none-any.whl
Collecting cryptography>=2.1.4 (from pyOpenSSL->scrapy)
Using cached cryptography-2.1.4.tar.gz
Collecting pyasn1-modules (from service-identity->scrapy)
Using cached pyasn1_modules-0.2.1-py2.py3-none-any.whl
Collecting pyasn1 (from service-identity->scrapy)
Using cached pyasn1-0.4.2-py2.py3-none-any.whl
Collecting attrs (from service-identity->scrapy)
Using cached attrs-17.4.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in ./lib/python3.7/site-packages (from zope.interface>=4.0.2->Twisted>=13.1.0->scrapy)
Collecting idna>=2.1 (from cryptography>=2.1.4->pyOpenSSL->scrapy)
Using cached idna-2.6-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=2.1.4->pyOpenSSL->scrapy)
Using cached asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting cffi>=1.7 (from cryptography>=2.1.4->pyOpenSSL->scrapy)
Using cached cffi-1.11.4.tar.gz
Complete output from command python setup.py egg_info:
No working compiler found, or bogus compiler options passed to
the compiler from Python's standard "distutils" module. See
the error messages above. Likely, the problem is not related
to CFFI but generic to the setup.py of any Python package that
tries to compile C code. (Hints: on OS/X 10.8, for errors about
-mno-fused-madd see http://stackoverflow.com/questions/22313407/
Otherwise, see https://wiki.python.org/moin/CompLangPython or
the IRC channel #python on irc.freenode.net.)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-kssg89y9/cffi/
但是,如果我只是以root身份登录,并在我作为其他用户创建的相同环境中执行相同的步骤,则可以正常工作:
以root身份登录
cd test
source bin/activate
pip install lxml
给出:
Collecting lxml
Downloading lxml-4.1.1.tar.gz (2.4MB)
100% |################################| 2.4MB 587kB/s
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml ... done
Stored in directory: /root/.cache/pip/wheels/5d/14/6a/e0bbcf0b91d5add2b0caa1f704d190b36474c4d29b16f25192
Successfully built lxml
Installing collected packages: lxml
Successfully installed lxml-4.1.1
和pip install scrapy给出:
Building wheels for collected packages: Twisted, PyDispatcher, zope.interface, cryptography, cffi, pycparser
Running setup.py bdist_wheel for Twisted ... done
Stored in directory: /root/.cache/pip/wheels/91/c7/95/0bb4d45bc4ed91375013e9b5f211ac3ebf4138d8858f84abbc
Running setup.py bdist_wheel for PyDispatcher ... done
Stored in directory: /root/.cache/pip/wheels/86/02/a1/5857c77600a28813aaf0f66d4e4568f50c9f133277a4122411
Running setup.py bdist_wheel for zope.interface ... done
Stored in directory: /root/.cache/pip/wheels/8b/39/98/0fcb72adfb12b2547273b1164d952f093f267e0324d58b6955
Running setup.py bdist_wheel for cryptography ... error
Complete output from command /home/intellinked/test/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ihrybujj/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmppn33yw48pip-wheel- --python-tag cp37:
Installed /tmp/pip-build-ihrybujj/cryptography/.eggs/cffi-1.11.4-py3.7-linux-x86_64.egg
Searching for pycparser
Reading https://pypi.python.org/simple/pycparser/
Downloading https://pypi.python.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed/pycparser-2.18.tar.gz#md5=72370da54358202a60130e223d488136
Best match: pycparser 2.18
Processing pycparser-2.18.tar.gz
Writing /tmp/easy_install-wl_p3ddu/pycparser-2.18/setup.cfg
Running pycparser-2.18/setup.py -q bdist_egg --dist-dir /tmp/easy_install-wl_p3ddu/pycparser-2.18/egg-dist-tmp-rj10qpmn
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-wl_p3ddu/pycparser-2.18/setup.py", line 54, in <module>
test_requirements.append("hypothesis>=1.11.4")
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.7/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.7/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 220, in run
os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 273, in zip_safe
return analyze_egg(self.bdist_dir, self.stubs)
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 383, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 422, in scan_module
code = marshal.load(f)
ValueError: bad marshal data (unknown type code)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ihrybujj/cryptography/setup.py", line 307, in <module>
**keywords_with_side_effects(sys.argv)
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/__init__.py", line 128, in setup
_install_setup_requires(attrs)
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
[truncated lines]
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 383, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 422, in scan_module
code = marshal.load(f)
ValueError: bad marshal data (unknown type code)
----------------------------------------
Failed building wheel for cryptography
Running setup.py clean for cryptography
Complete output from command /home/intellinked/test/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ihrybujj/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-qbqn1tgi/pycparser-2.18/setup.py", line 54, in <module>
test_requirements.append("hypothesis>=1.11.4")
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/lib/python3.7/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python3.7/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 220, in run
os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 273, in zip_safe
return analyze_egg(self.bdist_dir, self.stubs)
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 383, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 422, in scan_module
code = marshal.load(f)
ValueError: bad marshal data (unknown type code)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ihrybujj/cryptography/setup.py", line 307, in <module>
**keywords_with_side_effects(sys.argv)
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/__init__.py", line 128, in setup
_install_setup_requires(attrs)
[truncated lines]
cmd_obj.run()
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 220, in run
os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 273, in zip_safe
return analyze_egg(self.bdist_dir, self.stubs)
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 383, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/home/intellinked/test/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 422, in scan_module
code = marshal.load(f)
ValueError: bad marshal data (unknown type code)
----------------------------------------
Failed cleaning build dir for cryptography
Running setup.py bdist_wheel for cffi ... done
Stored in directory: /root/.cache/pip/wheels/18/7f/67/c799bfa004ac33e6de1c63bf5fe927dc0ba4bb3c4b149f47e9
Running setup.py bdist_wheel for pycparser ... done
Stored in directory: /root/.cache/pip/wheels/95/14/9a/5e7b9024459d2a6600aaa64e0ba485325aff7a9ac7489db1b6
Successfully built Twisted PyDispatcher zope.interface cffi pycparser
Failed to build cryptography
Installing collected packages: six, w3lib, cssselect, pyasn1, pyasn1-modules, idna, asn1crypto, pycparser, cffi, cryptography, pyOpenSSL, attrs, service-identity, parsel, zope.interface, constantly, incremental, Automat, hyperlink, Twisted, PyDispatcher, queuelib, scrapy
Running setup.py install for cryptography ... done
Successfully installed Automat-0.6.0 PyDispatcher-2.0.5 Twisted-17.9.0 asn1crypto-0.24.0 attrs-17.4.0 cffi-1.11.4 constantly-15.1.0 cryptography-2.1.4 cssselect-1.0.3 hyperlink-17.3.1 idna-2.6 incremental-17.5.0 parsel-1.4.0 pyOpenSSL-17.5.0 pyasn1-0.4.2 pyasn1-modules-0.2.1 pycparser-2.18 queuelib-1.4.2 scrapy-1.5.0 service-identity-17.0.0 six-1.11.0 w3lib-1.19.0 zope.interface-4.4.3
我做错了什么?感谢