zoukankan      html  css  js  c++  java
  • scrapy爬虫之环境安装

    环境安装之pycharm  

    pycharm的安装  官网下载安装

    技巧:linux中用命令行快速打开pycharm方法 在~/.bashrc文件中 写入 alias pycharm="bash /----pycharm安装包中python.sh的路径"

    ./bashrc 保存一些用户命令等  上述中alias 为别名   

    用source .bashrc 重启。

    环境安装之mysql 

    官网安装   linux中 sudo pip install mysql-server

    查看是否安装成功 ps aux|grep mysqld 

    设置mysql配置文件  对外访问权限 

    使用locate my.cnf命令可以列出所有的my.cnf文件

    查看进程是否使用了指定目录的my.cnf 命令 ps aux|grep mysql|grep 'my.cnf'

    如没有 则查看mysql默认读取my.cnf的目录 命令mysql --help|grep 'my.cnf'

    如没有则创建my.cnf 把数据库配置写入即可

    环境安装之navicat

    官网安装 破解激活方法https://www.cnblogs.com/guarderming/p/12573847.html

    navicat链接mysql条件 :1.设置mysql配置文件  对外访问ip权限 2. 用户使用权限 包括读取 写入等

    操作方法:

    1.找到mysql配置文件 把127.0.0.1 修改成0.0.0.0

    2.进入mysql 执行GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;

                                                                                            用户@ip                        by密码 

      flush privileges;刷新权限

    环境安装之python

    官网下载                           sudo apt-get install python3.8

    安装虚拟环境virtualenv    pip install -i https://pypi.douban.com/simple/ django 

     安装虚拟环境virtualenvwrapper  pip install virtualenvwrapper 

    创建虚拟环境 mkvirtualenv py3scrapy (workon 查看,mkvirtualenv 创建,deactivate  退出)

    安装scrapy  部分安装包失败解决方法 :https://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载后 pip install 安装包 

    通过pip list 查看安装包

    liunx中 

    安装  pip install virtualenvwrapper 

    配置

    找到启动文件路径 sudo find / -name  virtualenvwrapper.sh 

    在/.bashrc文件中 写入

    export WORKON_HOME=$HOME/.virtualenvs    配置虚拟环境目录
    VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
    source /usr/bin/virtualenvwrapper.sh    配置启动文件路径   

    source ~/.bashrc  执行修改文件    就可以使用workon等命令

  • 相关阅读:
    【leetcode】106. Construct Binary Tree from Inorder and Postorder Traversal
    【leetcode】105. Construct Binary Tree from Preorder and Inorder Traversal
    【leetcode】236. Lowest Common Ancestor of a Binary Tree
    【leetcode】235. Lowest Common Ancestor of a Binary Search Tree
    【leetcode】352. Data Stream as Disjoint Intervals
    【leetcode】897. Increasing Order Search Tree
    【leetcode】900. RLE Iterator
    BEC listen and translation exercise 26
    BEC listen and translation exercise 25
    BEC listen and translation exercise 24
  • 原文地址:https://www.cnblogs.com/zqlboke/p/13658628.html
Copyright © 2011-2022 走看看