How does scrapy default to python3 in python?

because I now default to python2.7 every time, now I want to start with python3 every time, ask for advice, how to default python3 now? Because of many coding problems

Jun.18,2022

install Anaconda with default Python 3.

I use Macbook


linux can create a virtual environment. Specify that the version of the virtual environment python is python3


if you don't need Python2.7, you can uninstall version 2.7.


you can create a virtual environment before creating a crawler project (pipenv or other methods are fine. I now create it with Pycharm setting). You can specify the Python version when creating the virtual environment. I have several Python versions installed on my computer (just for fun), and then activate the virtual environment before starting the crawler.
I have also written a blog about the Python virtual environment. Please refer to https://blog.csdn.net/wgPytho...


none of the above should be to the point. On the one hand, it depends on whether you execute it in an IDE like Pycharm or manually, and if you are in an IDE like Pycharm, there are settings to configure the current python environment.

if it is executed manually, and then you have python2.7 and python3.6 in your system, you can use python3 run.py to execute.


give you a website
pythonlibs/" rel=" nofollow noreferrer "> https://www.lfd.uci.edu/~gohl...

search scrapy

clipboard.png

Python2 Python3,
227K
, (Python2)


python3


windows\linux, , python3 python3, Pythonpython2,

pycharm, File -> Settings -> Project:xxxxxx -> Project Interpreter Python

clipboard.png

,

anaconda, conda

clipboard.png

enter Scrapy-1.6.0-py2.py3-none-any.whl the directory where this folder is located
if you anaconda do Python3
enter

pip install Scrapy-1.6.0-py2.py3-none-any.whl

Python2's words are almost the same as pytcharm modification, OK!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf6725-31fd8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf6725-31fd8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?