简体   繁体   English

如何在 Ubuntu 18.04 上的 Python3 中安装 Nest

[英]How to install nest in Python3 on Ubuntu 18.04

After following the Ubuntu/Debian installation instructions for the Nest simulator I can only import the nest module in python2.x, not python3.x按照Nest模拟器的Ubuntu / Debian安装说明后,我只能在python2.x中导入nest模块,而不是python3.x

$ python3
Python 3.6.8 (default, Aug 20 2019, 17:12:48) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nest
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nest/lib/python2.7/site-packages/nest/__init__.py", line 26, in <module>
    from . import ll_api      # noqa
  File "/nest/lib/python2.7/site-packages/nest/ll_api.py", line 72, in <module>
    from . import pynestkernel as kernel      # noqa
ImportError: dynamic module does not define module export function (PyInit_pynestkernel)

The default install compiles with the default Python version which is still 2 in Ubuntu.默认安装使用默认 Python 版本编译,该版本在 Ubuntu 中仍为 2。 To use Python 3, run:要使用 Python 3,请运行:

cmake -Dwith-python=3 -DCMAKE_INSTALL_PREFIX:PATH=</install/path> </path/to/NEST/src>

Mentioned here in the doc.在文档中提到这里

NB: don't forget to clear the build folder to avoid issues注意:不要忘记清除构建文件夹以避免出现问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM