我正在尝试为 python3 安装Biosig,但出现以下错误:
nahuel@nahuel-Notebook:~/Documents/TESIS/biosig-2.0.6$ python3 -c "import biosig"
Segmentation fault (core dumped)
我有 Linux Mint 19 Tara 和 Python 3.7.5
我安装了它:
nahuel@nahuel-Notebook:~$ python3 -m pip install --no-cache-dir https://pub.ist.ac.at/~schloegl/biosig/prereleases/Biosig-2.0.6.tar.gz
Defaulting to user installation because normal site-packages is not writeable
Collecting https://pub.ist.ac.at/~schloegl/biosig/prereleases/Biosig-2.0.6.tar.gz
Downloading https://pub.ist.ac.at/~schloegl/biosig/prereleases/Biosig-2.0.6.tar.gz (5.4 kB)
Requirement already satisfied (use --upgrade to upgrade): Biosig==2.0.6 from https://pub.ist.ac.at/~schloegl/biosig/prereleases/Biosig-2.0.6.tar.gz in ./.local/lib/python3.7/site-packages
Requirement already satisfied: numpy in ./.local/lib/python3.7/site-packages (from Biosig==2.0.6) (1.19.0)
Requirement already satisfied: setuptools>=6.0 in ./.local/lib/python3.7/site-packages (from Biosig==2.0.6) (50.3.0)
Building wheels for collected packages: Biosig
Building wheel for Biosig (setup.py) ... done
Created wheel for Biosig: filename=Biosig-2.0.6-cp37-cp37m-linux_x86_64.whl size=20899 sha256=a544649cda0a37de134b7dd6ed8dc1b801343589fbfef38d8cebab119e8e7c64
Stored in directory: /tmp/pip-ephem-wheel-cache-n7_nrhbm/wheels/09/43/21/972277ad502204398daed7cc76fbdecacbc3a66afeee8f8a94
Successfully built Biosig
nahuel@nahuel-Notebook:~$ python3 -c "import biosig"
Segmentation fault (core dumped)
并编译源代码:
make python
make -C biosig4c++/python build
make -C biosig4c++/python release
pip3 install biosig4c++/python/dist/Biosig-2.0.5.tar.gz
两者都相同的错误:
nahuel@nahuel-Notebook:~/Documents/TESIS/biosig-2.0.6$ python3 -v -c "import biosig"
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
...
...
...
import 'fcntl' # <class '_frozen_importlib.BuiltinImporter'>
import 'apt.progress.base' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa99f098dd0>
import 'apt.progress.text' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa99f08bc10>
import 'apt.package' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa99f320b50>
# /usr/lib/python3/dist-packages/apt/__pycache__/cache.cpython-37.pyc matches /usr/lib/python3/dist-packages/apt/cache.py
# code object from '/usr/lib/python3/dist-packages/apt/__pycache__/cache.cpython-37.pyc'
import 'apt.cache' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa99f328550>
# /usr/lib/python3/dist-packages/apt/__pycache__/cdrom.cpython-37.pyc matches /usr/lib/python3/dist-packages/apt/cdrom.py
# code object from '/usr/lib/python3/dist-packages/apt/__pycache__/cdrom.cpython-37.pyc'
import 'apt.cdrom' # <_frozen_importlib_external.SourceFileLoader object at 0x7fa99f098bd0>
Segmentation fault (core dumped)
我尝试调试:
nahuel@nahuel-Notebook:~/Documents/TESIS/bcitp$ python -Xfaulthandler -c "import biosig"
Fatal Python error: Segmentation fault
Current thread 0x00007f20bce4e740 (most recent call first):
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 34 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 728 in exec_module
File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 983 in _find_and_load
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 728 in exec_module
File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 983 in _find_and_load
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 728 in exec_module
File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 983 in _find_and_load
File "/usr/lib/python3/dist-packages/apport/report.py", line 30 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 728 in exec_module
File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 983 in _find_and_load
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5 in <module>
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 728 in exec_module
File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 983 in _find_and_load
File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 953 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 983 in _find_and_load
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72 in apport_excepthook
Segmentation fault (core dumped)
我安装推荐的软件包:
--- 运行时推荐的包 ---
sudo apt-get install libb64 tinyxml python-numpy python3-numpy R openjdk-11-jre octave octave-tsa octave-nan
E: Unable to locate package libb64 #but install libb64-dev
E: Unable to locate package tinyxml #but install libtinyxml-dev
E: Unable to locate package R #not installed
我还安装了 libbiosig-dev
奇怪的是 biosig 在 python2 中工作
我解决了这个问题:
sudo pip2 卸载 biosig sudo pip3 卸载 biosig sudo apt-get remove biosig-dev biosig1
并重新安装 ./configure && make && make install