用户登录
用户注册

分享至

解决pycharm安装scrapy DLL load failed:找不到指定的程序的问题

  • 作者: 张庄刘二蛋
  • 来源: 51数据库
  • 2021-09-28

note: 本解决方案在window10 + anaconda3 +pycharm2020.1.1 + scrapy安装亲测可用

问题:安装scrapy后,执行scrapy出现:

from cryptography.hazmat.bindings._openssl import ffi importerror: dll load failed:找不到指定的程序

个人认为是anaconda和pycharm的部分python库不能互相调用

即对于某些库,anaconda存在相同的库,在pycharm安装时不会再安装某些anaconda中已经存在的python库,但是pycharm可用检测到系统已存在这些库,但又不能调用anaconda的一些python库

(不一定是哪种方法解决了问题)

方法4解决了问题

1. 尝试过的方法:

方法1:把anacond的三个路径都写到环境变量path,系统本身就是这样,但依然出现相同的问题

方法2. 将anaconda promote 中的echo %path%的输入结果加到pycharm中的python console中,但依旧没有解决问题

方法3:依旧没有解决

(1)pip uninstall scrapy

(2) conda uninstall scrapy

(3) pip install --force --upgrade scrapy

(4)测试:scrapy

方法4:

(1)在pycharm的terminal中卸载scrapy

pip uninstall scrapy

(2)在anaconda prompt中卸载scrapy

conda uninstall scrapy

(3)在pycharm的terminal中安装scrapy

pip install scrapy

(4)如果此时还有些库出现问题,导致找不到程序,则在win10的命令行窗口卸载相应的库,再在pycharm的terminal中安装相应的库

可能存在idna版本过高的问题,

error: pip's dependency resolver does not currently take into account all the packages that are installed. this behaviour is the source of the
following dependency conflicts.
requests 2.25.1 requires idna<3,>=2.5, but you have idna 3.2 which is incompatible.

但是在pycharm的终端中卸载时却提示文件不存在

则需要在win10的命令行窗口卸载idna

pip uninstall idna

然后在pycharm的terminal中安装idna

pip install idna==2.5

安装过程中,可能出现如下错误

error: pip's dependency resolver does not currently take into account all the packages that are installed. this behaviour is the source of the
following dependency conflicts.
twisted 21.2.0 requires automat>=0.8.0, but you have automat 0.7.0 which is incompatible.

另外一些其他库的操作方法相同

例如,存在cryptography却不可调用,是因为cryptography原始安装在anaconda的环境中的

因此,在win10的命令行窗口卸载cryptography

pip uninstall cryptography

然后,在pycharm的terminal中安装cryptography

pip install cryptography

执行scrapy提示service_identity模块不存在

在pycharm中安装时却提示已经存在

则,在win10的命令行窗口卸载service_identity

pip uninstall service_identity

然后,在pycharm的terminal中安装service_identity

pip install service_identity

再次执行scrapy,提示如下,则scrapy安装成功

总结

在window的命令行窗口卸载相应的库,再在pycharm的终端中安装相应的库,即可解决问题,但可能导致anaconda的python环境存在问题,后期需要修复

以上就是解决pycharm安装scrapy dll load failed:找不到指定的程序的问题的详细内容,更多关于pycharm找不到指定的程序的资料请关注其它相关文章!

软件
前端设计
程序设计
Java相关