Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book_1_Ch_02__JupyterLab,关于import的错误 #19

Closed
yeqihai opened this issue May 29, 2023 · 5 comments
Closed

Book_1_Ch_02__JupyterLab,关于import的错误 #19

yeqihai opened this issue May 29, 2023 · 5 comments

Comments

@yeqihai
Copy link

yeqihai commented May 29, 2023

本课的习题是:从零开始复刻 Bk1_Ch2_01.ipynb

问题1:

但是在导入包的时候,因为numpy的版本不对
通过网络查询得知:https://blog.csdn.net/weixin_47001721/article/details/110354183
导致不能正常引入plotly.express模块,报错:plotly express requires pandas to be installed.

措施1:

替换numpy版本为1.19.3,中途遇到的问题,如果没有在jupyterlab的kernal sessions 终止掉,就会导致pip uninstall失败,从而产生一个奇怪的残留包,命名前缀为“~”,
从而导致这样的warning:WARNING: Ignoring invalid distribution -umpy (e:\anaconda\lib\site-packages)

问题2:

替换numpy版本后,matplotlib的版本又和numpy不兼容,导致matplotlib的导入错误

措施2:

折中一下,换成numpy==1.21,又会产生一些warning: warnings.warn("loaded more than 1 DLL from .libs:"

问题3

3.2的动态图,都无法通过运行展示,应该是plotly.express模块没有正确导入的原因

总结

anaconda的环境管理,python的安装包管理,希望ginger老师可以新增教程,感谢万分!

@yeqihai
Copy link
Author

yeqihai commented May 29, 2023

措施2的问题解决:

通过网络检索,定位问题应该是因为旧的numpy没有卸载掉,两版numpy导致出现冲突,因此把numpy相关的包在site-packages里面删掉,重新安装就ok了。
参考https://blog.csdn.net/qq_41295952/article/details/105214322

上述问题3仍未解决,动态图无法展示,如下图:
4

@Visualize-ML
Copy link
Owner

Visualize-ML commented May 30, 2023 via email

@yeqihai
Copy link
Author

yeqihai commented May 30, 2023

这个问题我还真没遇到过,你的Anaconda是官网下载的吗?

On Mon, May 29, 2023 at 3:29 AM yeqihai @.> wrote: 措施2的问题解决: 通过网络检索,定位问题应该是因为旧的numpy没有卸载掉,两版numpy导致出现冲突,因此把numpy相关的包在site-packages里面删掉,重新安装就ok了。 参考https://blog.csdn.net/qq_41295952/article/details/105214322 上述问题3仍未解决,动态图无法展示,如下图: [image: 4] https://user-images.githubusercontent.com/39910775/241673911-467017d8-5597-4fce-8b27-eb630e38ef99.png — Reply to this email directly, view it on GitHub <#19 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHC6V3M4KRZW5XG4AZGB3TXIRF6JANCNFSM6AAAAAAYSNGTSU . You are receiving this because you are subscribed to this thread.Message ID: @. com>

是在官网下载,但确实是几年之前下载的,所以可能会有版本兼容问题?

@Visualize-ML
Copy link
Owner

Visualize-ML commented May 30, 2023 via email

@yeqihai
Copy link
Author

yeqihai commented May 31, 2023

是的,建议卸载anaconda。重新安装anaconda,然后再装其他包比如streamlit

On Tue, May 30, 2023 at 11:46 AM yeqihai @.> wrote: 这个问题我还真没遇到过,你的Anaconda是官网下载的吗? … <#m_1467000383437359772_> On Mon, May 29, 2023 at 3:29 AM yeqihai @.> wrote: 措施2的问题解决: 通过网络检索,定位问题应该是因为旧的numpy没有卸载掉,两版numpy导致出现冲突,因此把numpy相关的包在site-packages里面删掉,重新安装就ok了。 参考https://blog.csdn.net/qq_41295952/article/details/105214322 https://blog.csdn.net/qq_41295952/article/details/105214322 上述问题3仍未解决,动态图无法展示,如下图: [image: 4] https://user-images.githubusercontent.com/39910775/241673911-467017d8-5597-4fce-8b27-eb630e38ef99.png https://user-images.githubusercontent.com/39910775/241673911-467017d8-5597-4fce-8b27-eb630e38ef99.png — Reply to this email directly, view it on GitHub <#19 (comment) <#19 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHC6V3M4KRZW5XG4AZGB3TXIRF6JANCNFSM6AAAAAAYSNGTSU https://github.com/notifications/unsubscribe-auth/AZHC6V3M4KRZW5XG4AZGB3TXIRF6JANCNFSM6AAAAAAYSNGTSU . You are receiving this because you are subscribed to this thread.Message ID: @. com> 是在官网下载,但确实是几年之前下载的,所以可能会有版本兼容问题? — Reply to this email directly, view it on GitHub <#19 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHC6V3HYW2OJN44XCG3YHDXIYI4VANCNFSM6AAAAAAYSNGTSU . You are receiving this because you commented.Message ID: @.**>

已更新到2023版本anaconda,代码的动态图渲染正常,问题已解决,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants