【PlayWright】报错:AttributeError: 'PlaywrightContextManager' object has no attribute '_playwright'的可能解决方案,。。而且网上的全是同


1.问题分析

1.1. 公司云桌面win7系统把之前C盘中自带的py3.7环境给还原了,之前跑得好好的PlayWright案例不能运行了

2.解决过程

2.1. 参考网上的解决方案,说是node的版本问题,但是我将之前可以运行的V12.22.12版本回退到V12.9.1以后,还是不行,但是我发现我的报错信息中,没有网上的这一段

Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher.
Setting the NODE_SKIP_PLATFORM_CHECK environment variable to 1 skips this
check, but Node.js might not execute correctly.

2.2. 重新翻阅安装过程,发现覆盖node.exe的这一步没有做,故覆盖完成后,即解决问题

3.思考

3.1. 因为系统的变更,所导致的环境问题,要再仔细的翻阅原来的安装文档,这次就是漏过了这个覆盖的细节,导致花费了很多功夫去重新查阅资料。。。而且网上的全是同一种说法,就很浪费时间且影响心情
3.2. 使用公司云桌面这类云系统的时候,尽量不要使用自带的py、java环境,说不准就会被还原掉,还是要装在不会被还原的个人/本地磁盘中。

4.参考文章:

4.1. https://blog.csdn.net/csdnchengxi/article/details/124495998

评论关闭