安装了两个python版本后,如何让scrapy使用python 3?

Chi*_*Abs 5 python scrapy

关于scrapy正在使用的python版本的快速问题。我从AURarchlinux 上的存储库安装了 scrapy ,它默认使用python 2.7. Scrapy 支持python 3.3+. 有谁知道如何在不卸载 2.7 的情况下强制它使用 3.3,在 Internet 上找不到任何内容。

eLR*_*uLL 5

Use virtualenv. You can install it with pip.

What I would normally do is go to the project folder, and create a virtual environment (envname) with the following command:

virtualenv -p python3 envname
Run Code Online (Sandbox Code Playgroud)

Enable it source envname/bin/activate and install everything you want. Now you have a Python3 environment (I think you need to install Scrapy again for the current environment).