Skip to content

Commit

Permalink
Changed 'src/49_Python_tips.md'.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnu4cn committed Apr 1, 2024
1 parent 8188168 commit 9031cc5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/49_Python_tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@


![使用导入的 `git` 模块](images/using-pygit.png)


## `import pandas` 报出 `segmentation fault`

Python 3.6.8 中,运行程序时,始终报出 `segmentation fault`。逐一排查,程序依赖 `pandas` 包,而 `pandas` 包又依赖 `numpy` 这个包。在环境中成功安装了 `numpy` 包后直接 `import numpy` 时,会报出 `segmentation fault`。此问题并非个例,如:[Segmentation fault (core dumped) while trying to print numpy and pandas objects in python via cygwin](https://stackoverflow.com/questions/70511576/segmentation-fault-core-dumped-while-trying-to-print-numpy-and-pandas-objectshttps://stackoverflow.com/questions/70511576/segmentation-fault-core-dumped-while-trying-to-print-numpy-and-pandas-objects)


但是,与上一个 `import git``segmentation fault` 类似,在 `import pandas`(或 `import numpy`)前,放一个 `import pip` 的行,就不会再报出 `segmentation fault` 错误。

0 comments on commit 9031cc5

Please sign in to comment.