2017-05-19 5 views
0

scrapyを別のpythonバージョンのvirtualenv環境で実行しようとしています。活性化した後Virtualenv:pythonを使ってvirtualenv envで `Scrapy`を実行する3.5エラーが発生する

virtualenv -p python3 NAME 
cd NAME  
source /bin/activate 

pip3 install scrapy 

それが正常にインストールされています。

python3のために、私は次のようでした。私はscrapyを実行したときしかし、私は次のエラーを取得する:

ImportError: /usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/_openssl.so: undefined symbol: PyInt_FromLong 

それは私のシステムのpython2.7を使用していることを示しています。

scrapyの異なるバージョンをpythonの異なるバージョンで実行することが、私の最終的な目標です。

EDIT:cryptographyモジュールに問題があると思います。

私は pip3 install --upgrade pyOpenSSLを試してみました、

私はこの得た:

Collecting pyOpenSSL 
    Using cached pyOpenSSL-17.0.0-py2.py3-none-any.whl 
Collecting cryptography>=1.7 (from pyOpenSSL) 
    Using cached cryptography-1.8.1.tar.gz 
Requirement already up-to-date: six>=1.5.2 in ./lib/python3.5/site-packages (from pyOpenSSL) 
Requirement already up-to-date: idna>=2.1 in ./lib/python3.5/site-packages (from cryptography>=1.7->pyOpenSSL) 
Requirement already up-to-date: asn1crypto>=0.21.0 in ./lib/python3.5/site-packages (from cryptography>=1.7->pyOpenSSL) 
Requirement already up-to-date: packaging in /usr/local/lib/python2.7/dist-packages (from cryptography>=1.7->pyOpenSSL) 
Collecting setuptools>=11.3 (from cryptography>=1.7->pyOpenSSL) 
    Using cached setuptools-35.0.2-py2.py3-none-any.whl 
Collecting cffi>=1.4.1 (from cryptography>=1.7->pyOpenSSL) 
    Using cached cffi-1.10.0-cp35-cp35m-manylinux1_x86_64.whl 
Requirement already up-to-date: pyparsing in /usr/local/lib/python2.7/dist-packages (from packaging->cryptography>=1.7->pyOpenSSL) 
Requirement already up-to-date: appdirs>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from setuptools>=11.3->cryptography>=1.7->pyOpenSSL) 
Requirement already up-to-date: pycparser in /usr/local/lib/python2.7/dist-packages (from cffi>=1.4.1->cryptography>=1.7->pyOpenSSL) 
Building wheels for collected packages: cryptography 
    Running setup.py bdist_wheel for cryptography ... error 
    Complete output from command /home/parth/gsoc/sample/try/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nvvy22iz/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/tmp66xa7d7xpip-wheel- --python-tag cp35: 
    Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    File "/tmp/pip-build-nvvy22iz/cryptography/setup.py", line 335, in <module> 
     **keywords_with_side_effects(sys.argv) 
    File "/usr/lib/python3.5/distutils/core.py", line 108, in setup 
     _setup_distribution = dist = klass(attrs) 
    File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 320, in __init__ 
     _Distribution.__init__(self, attrs) 
    File "/usr/lib/python3.5/distutils/dist.py", line 281, in __init__ 
     self.finalize_options() 
    File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 387, in finalize_options 
     ep.load()(self, ep.name, value) 
    File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 187, in cffi_modules 
     add_cffi_module(dist, cffi_module) 
    File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module 
     execfile(build_file_name, mod_vars) 
    File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 25, in execfile 
     exec(code, glob, glob) 
    File "src/_cffi_src/build_openssl.py", line 94, in <module> 
     extra_link_args=extra_link_args(compiler_type()), 
    File "/tmp/pip-build-nvvy22iz/cryptography/src/_cffi_src/utils.py", line 61, in build_ffi_for_binding 
     extra_link_args=extra_link_args, 
    File "/tmp/pip-build-nvvy22iz/cryptography/src/_cffi_src/utils.py", line 69, in build_ffi 
     ffi = FFI() 
    File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 56, in __init__ 
     import _cffi_backend as backend 
    ImportError: /usr/local/lib/python2.7/dist-packages/_cffi_backend.so: undefined symbol: _Py_ZeroStruct 

    ---------------------------------------- 
    Failed building wheel for cryptography 

Running setup.py clean for cryptography 
    Complete output from command /home/parth/gsoc/sample/try/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nvvy22iz/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: 
    Traceback (most recent call last): 
    File "<string>", line 1, in <module> 
    File "/tmp/pip-build-nvvy22iz/cryptography/setup.py", line 335, in <module> 
     **keywords_with_side_effects(sys.argv) 
    File "/usr/lib/python3.5/distutils/core.py", line 108, in setup 
     _setup_distribution = dist = klass(attrs) 
    File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 320, in __init__ 
     _Distribution.__init__(self, attrs) 
    File "/usr/lib/python3.5/distutils/dist.py", line 281, in __init__ 
     self.finalize_options() 
    File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 387, in finalize_options 
     ep.load()(self, ep.name, value) 
    File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 187, in cffi_modules 
     add_cffi_module(dist, cffi_module) 
    File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module 
     execfile(build_file_name, mod_vars) 
    File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 25, in execfile 
     exec(code, glob, glob) 
    File "src/_cffi_src/build_openssl.py", line 94, in <module> 
     extra_link_args=extra_link_args(compiler_type()), 
    File "/tmp/pip-build-nvvy22iz/cryptography/src/_cffi_src/utils.py", line 61, in build_ffi_for_binding 
     extra_link_args=extra_link_args, 
    File "/tmp/pip-build-nvvy22iz/cryptography/src/_cffi_src/utils.py", line 69, in build_ffi 
     ffi = FFI() 
    File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 56, in __init__ 
     import _cffi_backend as backend 
    ImportError: /usr/local/lib/python2.7/dist-packages/_cffi_backend.so: undefined symbol: _Py_ZeroStruct 

    ---------------------------------------- 
    Failed cleaning build dir for cryptography 
Failed to build cryptography 
Installing collected packages: setuptools, cffi, cryptography, pyOpenSSL 
    Found existing installation: setuptools 34.3.2 
    Not uninstalling setuptools at /usr/local/lib/python2.7/dist-packages, outside environment /home/parth/gsoc/sample/try 
    Found existing installation: cffi 1.9.1 
    Not uninstalling cffi at /usr/local/lib/python2.7/dist-packages, outside environment /home/parth/gsoc/sample/try 
    Found existing installation: cryptography 1.5.3 
    Not uninstalling cryptography at /usr/local/lib/python2.7/dist-packages, outside environment /home/parth/gsoc/sample/try 
    Running setup.py install for cryptography ... error 
    Complete output from command /home/parth/gsoc/sample/try/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-nvvy22iz/cryptography/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-tdsypb26-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/parth/gsoc/sample/try/include/site/python3.5/cryptography: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "/tmp/pip-build-nvvy22iz/cryptography/setup.py", line 335, in <module> 
     **keywords_with_side_effects(sys.argv) 
     File "/usr/lib/python3.5/distutils/core.py", line 108, in setup 
     _setup_distribution = dist = klass(attrs) 
     File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 320, in __init__ 
     _Distribution.__init__(self, attrs) 
     File "/usr/lib/python3.5/distutils/dist.py", line 281, in __init__ 
     self.finalize_options() 
     File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 387, in finalize_options 
     ep.load()(self, ep.name, value) 
     File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 187, in cffi_modules 
     add_cffi_module(dist, cffi_module) 
     File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module 
     execfile(build_file_name, mod_vars) 
     File "/usr/local/lib/python2.7/dist-packages/cffi/setuptools_ext.py", line 25, in execfile 
     exec(code, glob, glob) 
     File "src/_cffi_src/build_openssl.py", line 94, in <module> 
     extra_link_args=extra_link_args(compiler_type()), 
     File "/tmp/pip-build-nvvy22iz/cryptography/src/_cffi_src/utils.py", line 61, in build_ffi_for_binding 
     extra_link_args=extra_link_args, 
     File "/tmp/pip-build-nvvy22iz/cryptography/src/_cffi_src/utils.py", line 69, in build_ffi 
     ffi = FFI() 
     File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 56, in __init__ 
     import _cffi_backend as backend 
    ImportError: /usr/local/lib/python2.7/dist-packages/_cffi_backend.so: undefined symbol: _Py_ZeroStruct 

    ---------------------------------------- 
    Can't rollback cryptography, nothing uninstalled. 
+0

これは 'source/NAME/bin/activate'でなければなりませんか? –

+0

@RemyJこれは有効化されました。私はそれを入力する 'cd'をした。私もそれを書くべきです。 –

+0

try pip3インストールscrapy == 1.1.0rc1 –

答えて

-1

scrapy

または

sudoのピップはscrapyをインストールインストール

ピップで試してみてくださいを

そして、あなたが開いているpython3を書くときは?

+0

なぜsudoですか?また、それはそれがインストールされていると思った –

+0

うまくインストールされている質問は問題。 Pythonの部分についてはどうですか? – IsaBostan

+0

これはvirtualenvなので、どうですか? –

関連する問題