Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get scrapy to use python 3 when both python versions are installed?

Tags:

python

scrapy

Quick question regarding the version of python that's being used by scrapy. I installed scrapy from the AUR repository on archlinux and it defaults on using python 2.7. Scrapy has support forpython 3.3+. Does anyone know how to force it to use 3.3 without uninstalling 2.7, can't find anything on it on the internet.

like image 701
ChiseledAbs Avatar asked Dec 14 '16 19:12

ChiseledAbs


1 Answers

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

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).

like image 76
eLRuLL Avatar answered Sep 23 '22 15:09

eLRuLL