mac os (EI Capitian) 安装python遇到问题

参考:

http://www.jianshu.com/p/5265b76026d9

1.

sudo easy_install pip

sudo pip install Scrapy

遇到问题:

Exception:

Traceback (most recent call last):

  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main

    status = self.run(options, args)

  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run

    prefix=options.prefix_path,

  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 742, in install

    **kwargs

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 831, in install

    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files

    isolated=self.isolated,

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files

    clobber(source, lib_dir, True)

  File "/Library/Python/2.7/site-packages/pip/wheel.py", line 324, in clobber

    shutil.copyfile(srcfile, destfile)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile

    with open(dst, 'wb') as fdst:

IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/six.py'



在(EI Capitian 系统内 即使是root 用户也无权限删除这个目录,在国外的网站找到了下面的解决方式:

sudo -H pip install scrapy --ignore-installed six


参考:

https://github.com/pypa/pip/issues/3165

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
边缘强度EI可以通过计算图像的梯度来得到。在Python中,可以使用Sobel算子来计算图像的x和y方向的梯度,然后将两个方向的梯度进行加权相加得到边缘强度EI。 具体的计算步骤如下: 1. 将图像转换为灰度图像,如果原始图像已经是灰度图像则不需要进行转换。 2. 使用Sobel算子计算图像在x和y方向的梯度。在Python中,可以使用cv2.Sobel函数,设置参数dx=1和dy=0来计算x方向的梯度,设置参数dx=0和dy=1来计算y方向的梯度。 3. 对计算得到的梯度进行绝对值化,可以使用cv2.convertScaleAbs函数将梯度转换为绝对值类型。 4. 将x和y方向的梯度进行加权相加,可以使用cv2.addWeighted函数,设置参数alpha=0.5和beta=0.5来加权相加。 5. 得到的加权相加结果即为边缘强度EI。 值得注意的是,在计算梯度时,可能需要对图像进行预处理,例如将图像进行模糊或者增强对比度的操作,以提高边缘的清晰度和准确度。 中的代码示例展示了使用Sobel算子计算图像梯度的方法。方法1使用了cv2.Sobel函数,而方法2手动定义了Sobel算子的卷积核并使用cv2.filter2D函数进行卷积运算。无论使用哪种方法,最终得到的ixy即为边缘强度EI。 请注意,本回答仅提供了计算边缘强度EI的方法,具体的代码实现需要根据实际情况进行调整和完善。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [图像融合评估指标Python版](https://blog.csdn.net/fovever_/article/details/129332278)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [cv::边缘检测原理,Python代码实现](https://blog.csdn.net/qq_40242410/article/details/129442731)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值