在 PyCharm 中为 PyPy3 创建新的虚拟环境

Creating a new Virtual Environment for PyPy3 in PyCharm

当我尝试使用 pypy3 作为基础解释器创建一个新的虚拟环境时,我在 PyCharm 中收到此错误:

我在 2015 年底的 64 位 MacBook pro 上使用 MacOS sierra PyCharm 2016.3

执行的命令:

/Applications/PyCharm CE.app/Contents/helpers/packaging_tool.py list

命令输出:

dyld: Library not loaded: @rpath/libpypy-c.dylib
  Referenced from: /Users/3228991/.virtualenvs/pypy3_venv/bin/python
  Reason: image not found
dyld: Library not loaded: @rpath/libpypy-c.dylib
  Referenced from: /Users/3228991/.virtualenvs/pypy3_venv/bin/python
  Reason: image not found

表示您的程序正在使用名为 libpypy-c.dylib 的动态库,尽管您在编译期间将动态库链接到您的程序。但是你必须告诉你的程序 运行-time in Pycharm.

中的 dylib 在哪里

为您的项目设置动态库环境变量:

1.Run/Edit 配置

2.ClickPython,点击"Before Launch"下方的“+”按钮

3.Put DYLD_LIBRARY_PATH 到名称框

4.Put libpypy-c.dylib 文件在程序框中的路径