ubuntu中指定python版本执行命令

执行此命令时,sudo python3 setup.py install,提示setuptools未安装.
但我已经安装好了,打算换另一个python来执行这条命令,先查看你的python版本:which python ,得到路径 例如我的在/home/nvidia/archiconda3/bin/python3 里面.

因此输入sudo /home/nvidia/archiconda3/bin/python3 setup.py install即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Python 爬虫 本项目依赖Python的BeautifulSoup4第三方库,使用本项目需要先安装BeautifulSoup4。 步骤一 安装依赖库: 安装BeautifulSoup4: 1.Debain或Ubuntu可以通过系统软件包管理安装 $sudo apt-get install Python-bs4 2.使用easy_install或者pip安装: $ sudo easy_install beautifulsoup4 或$ sudo pip install beautifulsoup4 easy_install和pip是Python的发行包管理工具,同样需要先安装才能使用,这里介绍easy_install的安装方法: 1.Mac OS X 系统可以在终端执行以下命令: curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python 2.Linux系统可以执行以下命令: wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python 3.Window系统: 下载ez_setup.py并运行 步骤二 运行: 运行sexy.py文件爬取网站一: 1.不带参数运行:直接运行sexy.py,使用默认配置参数。 2.可用参数: -s 或 --startpage :起始扫描页面,默认值为1,从第一页开始扫描 -e 或 --endpage :最后扫描页面,默认值为65589。 -d 或 --dir :相对当前文件,下载图片保存位置,默认为sexy_images文件夹 -m 或 --max :获取页面失败后最大重试次数,默认为3 -n 或 --new :只获取最新更新的图片,强制设置起始扫描页为1,获取完毕后自动退出 例子:Sexy$ ./sexy.py -s 10 -e 12 -d cache -m 3 表示从第10页开始扫描到第12页,图片保存文件夹为cache,获取页面失败最多可以尝试3次。 3.运行期间可以随时按回车键退出程序。 运行atlas.py文件爬取网站二: 1.不带参数运行:直接运行atlas.py,使用默认配置参数,从主页开始爬取。 2.可用参数: -d 或 --dir :相对当前文件,下载图片保存位置,默认为atlas_images文件夹 -m 或 --max :获取页面失败后最大重试次数,默认为3 -v 或 --view :查看当前已知标签和标签id -t 或 --tag :爬取指定标签名的图片,同时提供标签id时,本标签无效 -i 或 --id :爬取指定标签id的图片 -l 或 --last :是否从上次退出的地方继续爬取,默认为false 3.运行过程可以随时按Ctrl+C退出,退出时如果还有新发现标签没有归类,归类后自动退出。 4.setting文件为已归类标签和最后抓取位置缓存,请勿删除。 测试环境: python 2.7 测试通过 License Copyright 2015 Jianan - [email protected] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值